C++ API and example

1. Introduction

This page exist in order to extract the examples from the Doxygen documentation, Please have look at the end of this page there are all the examples.

2. C++ API and example

template<typename Policy>
class accessor : public object_api<accessor<Policy>>, public object_api<accessor<Policy>>
#include <pytypes.h>

Public Functions

inline accessor(handle obj, key_type key)
accessor(const accessor&) = default
accessor(accessor&&) = default
inline void operator=(const accessor &a) &&
inline void operator=(const accessor &a) &
template<typename T>
inline void operator=(T &&value) &&
template<typename T>
inline void operator=(T &&value) &
inline accessor(handle obj, key_type key)
accessor(const accessor&) = default
accessor(accessor&&) = default
inline void operator=(const accessor &a) &&
inline void operator=(const accessor &a) &
template<typename T>
inline void operator=(T &&value) &&
template<typename T>
inline void operator=(T &&value) &

Public Members

template<typename T = Policy> PYBIND11_DEPRECATED("Use of obj.attr(...) as bool is deprecated in favor of pybind11::hasattr(obj, ...)") explicit operator enable_if_t< std key_type key
mutable object cache

Private Types

using key_type = typename Policy::key_type
using key_type = typename Policy::key_type
template<typename F>
class testing::Action
#include <gmock-actions.h>

Public Types

typedef internal::Function<F>::Result Result
typedef internal::Function<F>::ArgumentTuple ArgumentTuple
typedef internal::Function<F>::Result Result
typedef internal::Function<F>::ArgumentTuple ArgumentTuple

Public Functions

inline Action()
template<typename G, typename = typename std::enable_if<internal::disjunction<IsCompatibleFunctor<G>, std::is_constructible<std::function<Result()>, G>>::value>::type>
inline Action(G &&fun)
inline explicit Action(ActionInterface<F> *impl)
template<typename Func>
inline explicit Action(const Action<Func> &action)
inline bool IsDoDefault() const
inline Result Perform(ArgumentTuple args) const
inline Action()
template<typename G, typename = typename std::enable_if<internal::disjunction<IsCompatibleFunctor<G>, std::is_constructible<std::function<Result()>, G>>::value>::type>
inline Action(G &&fun)
inline explicit Action(ActionInterface<F> *impl)
template<typename Func>
inline explicit Action(const Action<Func> &action)
inline bool IsDoDefault() const
inline Result Perform(ArgumentTuple args) const

Private Types

using IsCompatibleFunctor = std::is_constructible<std::function<F>, G>
using IsCompatibleFunctor = std::is_constructible<std::function<F>, G>

Private Functions

template<typename G>
inline void Init(G &&g, ::std::true_type)
template<typename G>
inline void Init(G &&g, ::std::false_type)
template<typename G>
inline void Init(G &&g, ::std::true_type)
template<typename G>
inline void Init(G &&g, ::std::false_type)

Private Members

::std::function<F> fun_

Friends

friend class Action
struct testing::Action::ActionAdapter

Public Functions

template<typename ...Args>
inline internal::Function<F>::Result operator()(Args&&... args)
template<typename ...Args>
inline internal::Function<F>::Result operator()(Args&&... args)

Public Members

::std::shared_ptr<ActionInterface<F>> impl_
template<typename F, typename Impl>
struct ActionImpl
#include <gmock-actions.h>
template<typename R, typename ...Args, typename Impl>
struct testing::internal::ActionImpl<R(Args...), Impl> : public ImplBase::type<Impl>, public ImplBase::type<Impl>
#include <gmock-actions.h>

Public Types

using Base = typename ImplBase<Impl>::type
using function_type = R(Args...)
using args_type = std::tuple<Args...>
using Base = typename ImplBase<Impl>::type
using function_type = R(Args...)
using args_type = std::tuple<Args...>

Public Functions

ActionImpl() = default
inline explicit ActionImpl(std::shared_ptr<Impl> impl)
inline R operator()(Args&&... arg) const
template<std::size_t... arg_id, std::size_t... excess_id>
inline R Apply(IndexSequence<arg_id...>, IndexSequence<excess_id...>, const args_type &args) const
ActionImpl() = default
inline explicit ActionImpl(std::shared_ptr<Impl> impl)
inline R operator()(Args&&... arg) const
template<std::size_t... arg_id, std::size_t... excess_id>
inline R Apply(IndexSequence<arg_id...>, IndexSequence<excess_id...>, const args_type &args) const
template<typename F>
class testing::ActionInterface
#include <gmock-actions.h>

Subclassed by testing::internal::IgnoreResultAction< A >::Impl< F >, testing::internal::IgnoreResultAction< A >::Impl< F >, testing::internal::ReturnAction< R >::Impl< R_, F >, testing::internal::ReturnAction< R >::Impl< R_, F >, testing::internal::ReturnAction< R >::Impl< ByMoveWrapper< R_ >, F >, testing::internal::ReturnAction< R >::Impl< ByMoveWrapper< R_ >, F >, testing::internal::ReturnRefAction< T >::Impl< F >, testing::internal::ReturnRefAction< T >::Impl< F >, testing::internal::ReturnRefOfCopyAction< T >::Impl< F >, testing::internal::ReturnRefOfCopyAction< T >::Impl< F >, testing::PolymorphicAction< Impl >::MonomorphicImpl< F >, testing::PolymorphicAction< Impl >::MonomorphicImpl< F >

Public Types

typedef internal::Function<F>::Result Result
typedef internal::Function<F>::ArgumentTuple ArgumentTuple
typedef internal::Function<F>::Result Result
typedef internal::Function<F>::ArgumentTuple ArgumentTuple

Public Functions

inline ActionInterface()
inline virtual ~ActionInterface()
virtual Result Perform(const ArgumentTuple &args) = 0
inline ActionInterface()
inline virtual ~ActionInterface()
virtual Result Perform(const ArgumentTuple &args) = 0

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionInterface)
GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionInterface)
struct AHashTable

Public Types

typedef void hasher
template<typename ...Args>
struct alias_constructor
#include <init.h>

Public Static Functions

template<typename Class, typename ...Extra, enable_if_t<Class::has_alias && std::is_constructible<Alias<Class>, Args...>::value, int> = 0>
static inline void execute(Class &cl, const Extra&... extra)
template<typename Class, typename ...Extra, enable_if_t<Class::has_alias && std::is_constructible<Alias<Class>, Args...>::value, int> = 0>
static inline void execute(Class &cl, const Extra&... extra)
class AllowsGenericStreaming
template<typename T>
class testing::gtest_printers_test::AllowsGenericStreamingAndImplicitConversionTemplate

Public Functions

inline operator bool() const
template<typename T>
class AllowsGenericStreamingTemplate
template<typename T, bool Value = false>
struct always_construct_holder
#include <cast.h>

Public Static Attributes

static constexpr bool value = Value
template<typename T>
class any_container
#include <common.h>

Public Functions

any_container() = default
template<typename It, typename = enable_if_t<is_input_iterator<It>::value>>
inline any_container(It first, It last)
template<typename Container, typename = enable_if_t<std::is_convertible<decltype(*std::begin(std::declval<const Container&>())), T>::value>>
inline any_container(const Container &c)
template<typename TIn, typename = enable_if_t<std::is_convertible<TIn, T>::value>>
inline any_container(const std::initializer_list<TIn> &c)
inline any_container(std::vector<T> &&v)
inline operator std::vector<T>&&() &&
inline std::vector<T> &operator*()
inline const std::vector<T> &operator*() const
inline std::vector<T> *operator->()
inline const std::vector<T> *operator->() const
any_container() = default
template<typename It, typename = enable_if_t<is_input_iterator<It>::value>>
inline any_container(It first, It last)
template<typename Container, typename = enable_if_t<std::is_convertible<decltype(*std::begin(std::declval<const Container&>())), T>::value>>
inline any_container(const Container &c)
template<typename TIn, typename = enable_if_t<std::is_convertible<TIn, T>::value>>
inline any_container(const std::initializer_list<TIn> &c)
inline any_container(std::vector<T> &&v)
inline operator std::vector<T>&&() &&
inline std::vector<T> &operator*()
inline const std::vector<T> &operator*() const
inline std::vector<T> *operator->()
inline const std::vector<T> *operator->() const

Private Members

std::vector<T> v
struct arg
#include <cast.h>

Annotation for arguments.

Subclassed by arg_v, arg_v

Public Functions

inline explicit constexpr arg(const char *name = nullptr)

Constructs an argument with the name of the argument; if null or omitted, this is a positional argument.

template<typename T>
arg_v operator=(T &&value) const

Assign a value to this argument.

inline arg &noconvert(bool flag = true)

Indicate that the type should not be converted in the type caster.

inline arg &none(bool flag = true)

Indicates that the argument should/shouldn’t allow None (e.g. for nullable pointer args)

inline explicit constexpr arg(const char *name = nullptr)

Constructs an argument with the name of the argument; if null or omitted, this is a positional argument.

template<typename T>
arg_v operator=(T &&value) const

Assign a value to this argument.

inline arg &noconvert(bool flag = true)

Indicate that the type should not be converted in the type caster.

inline arg &none(bool flag = true)

Indicates that the argument should/shouldn’t allow None (e.g. for nullable pointer args)

Public Members

const char *name

If non-null, this is a named kwargs argument.

bool flag_noconvert

If set, do not allow conversion (requires a supporting type caster!)

bool flag_none

If set (the default), allow None to be passed to this argument.

struct arg_v : public arg, public arg
#include <cast.h>

Annotation for arguments with values.

Public Functions

template<typename T>
inline arg_v(const char *name, T &&x, const char *descr = nullptr)

Direct construction with name, default, and description.

template<typename T>
inline arg_v(const arg &base, T &&x, const char *descr = nullptr)

Called internally when invoking py::arg("a") = value

inline arg_v &noconvert(bool flag = true)

Same as arg::noconvert(), but returns *this as arg_v&, not arg&.

inline arg_v &none(bool flag = true)

Same as arg::nonone(), but returns *this as arg_v&, not arg&.

template<typename T>
inline arg_v(const char *name, T &&x, const char *descr = nullptr)

Direct construction with name, default, and description.

template<typename T>
inline arg_v(const arg &base, T &&x, const char *descr = nullptr)

Called internally when invoking py::arg("a") = value

inline arg_v &noconvert(bool flag = true)

Same as arg::noconvert(), but returns *this as arg_v&, not arg&.

inline arg_v &none(bool flag = true)

Same as arg::nonone(), but returns *this as arg_v&, not arg&.

Public Members

object value

The default value.

const char *descr

The (optional) description of the default value.

std::string type

The C++ type name of the default value (only available when compiled in debug mode)

Private Functions

template<typename T>
inline arg_v(arg &&base, T &&x, const char *descr = nullptr)
template<typename T>
inline arg_v(arg &&base, T &&x, const char *descr = nullptr)
class args : public tuple, public tuple
#include <pytypes.h>
class args_proxy : public handle, public handle
#include <pytypes.h>

Public Functions

inline explicit args_proxy(handle h)
inline kwargs_proxy operator*() const
inline explicit args_proxy(handle h)
inline kwargs_proxy operator*() const
template<typename ...Args>
class argument_loader
#include <cast.h>

Helper class which loads arguments for C++ functions called from Python.

Public Functions

inline bool load_args(function_call &call)
template<typename Return, typename Guard, typename Func>
inline enable_if_t<!std::is_void<Return>::value, Return> call(Func &&f) &&
template<typename Return, typename Guard, typename Func>
inline enable_if_t<std::is_void<Return>::value, void_type> call(Func &&f) &&
inline bool load_args(function_call &call)
template<typename Return, typename Guard, typename Func>
inline enable_if_t<!std::is_void<Return>::value, Return> call(Func &&f) &&
template<typename Return, typename Guard, typename Func>
inline enable_if_t<std::is_void<Return>::value, void_type> call(Func &&f) &&

Public Static Attributes

static constexpr bool has_kwargs = kwargs_pos < 0
static constexpr bool has_args = args_pos < 0
static constexpr auto arg_names = concat(type_descr(make_caster<Args>::name)...)

Private Types

using indices = make_index_sequence<sizeof...(Args)>
using argument_is_args = std::is_same<intrinsic_t<Arg>, args>
using argument_is_kwargs = std::is_same<intrinsic_t<Arg>, kwargs>
using indices = make_index_sequence<sizeof...(Args)>
using argument_is_args = std::is_same<intrinsic_t<Arg>, args>
using argument_is_kwargs = std::is_same<intrinsic_t<Arg>, kwargs>

Private Functions

template<size_t... Is>
inline bool load_impl_sequence(function_call &call, index_sequence<Is...>)
template<typename Return, typename Func, size_t... Is, typename Guard>
inline Return call_impl(Func &&f, index_sequence<Is...>, Guard&&) &&
template<size_t... Is>
inline bool load_impl_sequence(function_call &call, index_sequence<Is...>)
template<typename Return, typename Func, size_t... Is, typename Guard>
inline Return call_impl(Func &&f, index_sequence<Is...>, Guard&&) &&

Private Members

std::tuple<make_caster<Args>...> argcasters

Private Static Functions

static inline bool load_impl_sequence(function_call&, index_sequence<>)
static inline bool load_impl_sequence(function_call&, index_sequence<>)

Private Static Attributes

static constexpr auto args_pos = constexpr_first<argument_is_args, Args...>() - (int)sizeof...(Args)
static constexpr auto kwargs_pos = constexpr_first<argument_is_kwargs, Args...>() - (int)sizeof...(Args)
static constexpr bool args_kwargs_are_last = kwargs_pos >= -1 && args_pos >= kwargs_pos - 1
struct argument_record
#include <attr.h>

Internal data structure which holds metadata about a keyword argument.

Public Functions

inline argument_record(const char *name, const char *descr, handle value, bool convert, bool none)
inline argument_record(const char *name, const char *descr, handle value, bool convert, bool none)

Public Members

const char *name

Argument name.

const char *descr

Human-readable version of the argument value.

handle value

Associated Python object.

bool convert

True if the argument is allowed to convert when loading.

bool none

True if None is allowed when loading.

struct arithmetic
#include <attr.h>

Annotation to mark enums as an arithmetic type.

class array : public buffer, public buffer
#include <numpy.h>

Subclassed by array_t< T, ExtraFlags >, array_t< T, ExtraFlags >, array_t< Scalar, array::forcecast|((props::row_major ? props::inner_stride :props::outer_stride)==1 ? array::c_style :(props::row_major ? props::outer_stride :props::inner_stride)==1 ? array::f_style :0)>, array_t< Scalar, array::forcecast|((props::row_major ? props::inner_stride :props::outer_stride)==1 ? array::c_style :(props::row_major ? props::outer_stride :props::inner_stride)==1 ? array::f_style :0)>

Public Types

enum [anonymous]

Values:

enumerator c_style
enumerator f_style
enumerator forcecast
enum [anonymous]

Values:

enumerator c_style
enumerator f_style
enumerator forcecast
using ShapeContainer = detail::any_container<ssize_t>
using StridesContainer = detail::any_container<ssize_t>
using ShapeContainer = detail::any_container<ssize_t>
using StridesContainer = detail::any_container<ssize_t>

Public Functions

inline array()
inline array(const pybind11::dtype &dt, ShapeContainer shape, StridesContainer strides, const void *ptr = nullptr, handle base = handle())
inline array(const pybind11::dtype &dt, ShapeContainer shape, const void *ptr = nullptr, handle base = handle())
template<typename T, typename = detail::enable_if_t<std::is_integral<T>::value && !std::is_same<bool, T>::value>>
inline array(const pybind11::dtype &dt, T count, const void *ptr = nullptr, handle base = handle())
template<typename T>
inline array(ShapeContainer shape, StridesContainer strides, const T *ptr, handle base = handle())
template<typename T>
inline array(ShapeContainer shape, const T *ptr, handle base = handle())
template<typename T>
inline explicit array(ssize_t count, const T *ptr, handle base = handle())
inline explicit array(const buffer_info &info)
inline pybind11::dtype dtype() const

Array descriptor (dtype)

inline ssize_t size() const

Total number of elements.

inline ssize_t itemsize() const

Byte size of a single element.

inline ssize_t nbytes() const

Total number of bytes.

inline ssize_t ndim() const

Number of dimensions.

inline object base() const

Base object.

inline const ssize_t *shape() const

Dimensions of the array.

inline ssize_t shape(ssize_t dim) const

Dimension along a given axis.

inline const ssize_t *strides() const

Strides of the array.

inline ssize_t strides(ssize_t dim) const

Stride along a given axis.

inline int flags() const

Return the NumPy array flags.

inline bool writeable() const

If set, the array is writeable (otherwise the buffer is read-only)

inline bool owndata() const

If set, the array owns the data (will be freed when the array is deleted)

template<typename ...Ix>
inline const void *data(Ix... index) const

Pointer to the contained data.

If index is not provided, points to the beginning of the buffer. May throw if the index would lead to out of bounds access.

template<typename ...Ix>
inline void *mutable_data(Ix... index)

Mutable pointer to the contained data.

If index is not provided, points to the beginning of the buffer. May throw if the index would lead to out of bounds access. May throw if the array is not writeable.

template<typename ...Ix>
inline ssize_t offset_at(Ix... index) const

Byte offset from beginning of the array to a given index (full or partial).

May throw if the index would lead to out of bounds access.

inline ssize_t offset_at() const
template<typename ...Ix>
inline ssize_t index_at(Ix... index) const

Item count from beginning of the array to a given index (full or partial).

May throw if the index would lead to out of bounds access.

template<typename T, ssize_t Dims = -1>
inline detail::unchecked_mutable_reference<T, Dims> mutable_unchecked() &

Returns a proxy object that provides access to the array’s data without bounds or dimensionality checking.

Will throw if the array is missing the writeable flag. Use with care: the array must not be destroyed or reshaped for the duration of the returned object, and the caller must take care not to access invalid dimensions or dimension indices.

template<typename T, ssize_t Dims = -1>
inline detail::unchecked_reference<T, Dims> unchecked() const &

Returns a proxy object that provides const access to the array’s data without bounds or dimensionality checking.

Unlike mutable_unchecked(), this does not require that the underlying array have the writable flag. Use with care: the array must not be destroyed or reshaped for the duration of the returned object, and the caller must take care not to access invalid dimensions or dimension indices.

inline array squeeze()

Return a new view with all of the dimensions of length 1 removed.

inline void resize(ShapeContainer new_shape, bool refcheck = true)

Resize array to given shape If refcheck is true and more that one reference exist to this array then resize will succeed only if it makes a reshape, i.e.

original size doesn’t change

inline array()
inline array(const pybind11::dtype &dt, ShapeContainer shape, StridesContainer strides, const void *ptr = nullptr, handle base = handle())
inline array(const pybind11::dtype &dt, ShapeContainer shape, const void *ptr = nullptr, handle base = handle())
template<typename T, typename = detail::enable_if_t<std::is_integral<T>::value && !std::is_same<bool, T>::value>>
inline array(const pybind11::dtype &dt, T count, const void *ptr = nullptr, handle base = handle())
template<typename T>
inline array(ShapeContainer shape, StridesContainer strides, const T *ptr, handle base = handle())
template<typename T>
inline array(ShapeContainer shape, const T *ptr, handle base = handle())
template<typename T>
inline explicit array(ssize_t count, const T *ptr, handle base = handle())
inline explicit array(const buffer_info &info)
inline pybind11::dtype dtype() const

Array descriptor (dtype)

inline ssize_t size() const

Total number of elements.

inline ssize_t itemsize() const

Byte size of a single element.

inline ssize_t nbytes() const

Total number of bytes.

inline ssize_t ndim() const

Number of dimensions.

inline object base() const

Base object.

inline const ssize_t *shape() const

Dimensions of the array.

inline ssize_t shape(ssize_t dim) const

Dimension along a given axis.

inline const ssize_t *strides() const

Strides of the array.

inline ssize_t strides(ssize_t dim) const

Stride along a given axis.

inline int flags() const

Return the NumPy array flags.

inline bool writeable() const

If set, the array is writeable (otherwise the buffer is read-only)

inline bool owndata() const

If set, the array owns the data (will be freed when the array is deleted)

template<typename ...Ix>
inline const void *data(Ix... index) const

Pointer to the contained data.

If index is not provided, points to the beginning of the buffer. May throw if the index would lead to out of bounds access.

template<typename ...Ix>
inline void *mutable_data(Ix... index)

Mutable pointer to the contained data.

If index is not provided, points to the beginning of the buffer. May throw if the index would lead to out of bounds access. May throw if the array is not writeable.

template<typename ...Ix>
inline ssize_t offset_at(Ix... index) const

Byte offset from beginning of the array to a given index (full or partial).

May throw if the index would lead to out of bounds access.

inline ssize_t offset_at() const
template<typename ...Ix>
inline ssize_t index_at(Ix... index) const

Item count from beginning of the array to a given index (full or partial).

May throw if the index would lead to out of bounds access.

template<typename T, ssize_t Dims = -1>
inline detail::unchecked_mutable_reference<T, Dims> mutable_unchecked() &

Returns a proxy object that provides access to the array’s data without bounds or dimensionality checking.

Will throw if the array is missing the writeable flag. Use with care: the array must not be destroyed or reshaped for the duration of the returned object, and the caller must take care not to access invalid dimensions or dimension indices.

template<typename T, ssize_t Dims = -1>
inline detail::unchecked_reference<T, Dims> unchecked() const &

Returns a proxy object that provides const access to the array’s data without bounds or dimensionality checking.

Unlike mutable_unchecked(), this does not require that the underlying array have the writable flag. Use with care: the array must not be destroyed or reshaped for the duration of the returned object, and the caller must take care not to access invalid dimensions or dimension indices.

inline array squeeze()

Return a new view with all of the dimensions of length 1 removed.

inline void resize(ShapeContainer new_shape, bool refcheck = true)

Resize array to given shape If refcheck is true and more that one reference exist to this array then resize will succeed only if it makes a reshape, i.e.

original size doesn’t change

Public Static Functions

static inline array ensure(handle h, int ExtraFlags = 0)

Ensure that the argument is a NumPy array In case of an error, nullptr is returned and the Python error is cleared.

static inline array ensure(handle h, int ExtraFlags = 0)

Ensure that the argument is a NumPy array In case of an error, nullptr is returned and the Python error is cleared.

Protected Functions

inline void fail_dim_check(ssize_t dim, const std::string &msg) const
template<typename ...Ix>
inline ssize_t byte_offset(Ix... index) const
inline void check_writeable() const
template<typename ...Ix>
inline void check_dimensions(Ix... index) const
inline void check_dimensions_impl(ssize_t, const ssize_t*) const
template<typename ...Ix>
inline void check_dimensions_impl(ssize_t axis, const ssize_t *shape, ssize_t i, Ix... index) const
inline void fail_dim_check(ssize_t dim, const std::string &msg) const
template<typename ...Ix>
inline ssize_t byte_offset(Ix... index) const
inline void check_writeable() const
template<typename ...Ix>
inline void check_dimensions(Ix... index) const
inline void check_dimensions_impl(ssize_t, const ssize_t*) const
template<typename ...Ix>
inline void check_dimensions_impl(ssize_t axis, const ssize_t *shape, ssize_t i, Ix... index) const

Protected Static Functions

static inline std::vector<ssize_t> c_strides(const std::vector<ssize_t> &shape, ssize_t itemsize)
static inline std::vector<ssize_t> f_strides(const std::vector<ssize_t> &shape, ssize_t itemsize)
static inline PyObject *raw_array(PyObject *ptr, int ExtraFlags = 0)

Create array from any object always returns a new reference.

static inline std::vector<ssize_t> c_strides(const std::vector<ssize_t> &shape, ssize_t itemsize)
static inline std::vector<ssize_t> f_strides(const std::vector<ssize_t> &shape, ssize_t itemsize)
static inline PyObject *raw_array(PyObject *ptr, int ExtraFlags = 0)

Create array from any object always returns a new reference.

Friends

friend struct detail::npy_format_descriptor
friend struct detail::npy_format_descriptor
template<typename ArrayType, typename Value, bool Resizable, size_t Size = 0>
struct array_caster
#include <stl.h>

Public Types

using value_conv = make_caster<Value>
using value_conv = make_caster<Value>

Public Functions

inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (ArrayType, _("List[")+value_conv::name+_< Resizable >(_(""), _("[")+_< Size >()+_("]"))+_("]"))
inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (ArrayType, _("List[")+value_conv::name+_< Resizable >(_(""), _("[")+_< Size >()+_("]"))+_("]"))

Public Static Functions

template<typename T>
static inline handle cast(T &&src, return_value_policy policy, handle parent)
template<typename T>
static inline handle cast(T &&src, return_value_policy policy, handle parent)

Private Functions

template<bool R = Resizable>
inline bool require_size(enable_if_t<R, size_t> size)
template<bool R = Resizable>
inline bool require_size(enable_if_t<!R, size_t> size)
template<bool R = Resizable>
inline bool require_size(enable_if_t<R, size_t> size)
template<bool R = Resizable>
inline bool require_size(enable_if_t<!R, size_t> size)
template<typename T>
struct array_info : public array_info_scalar<T>, public array_info_scalar<T>
#include <numpy.h>
template<size_t N>
struct array_info<char[N]> : public array_info_scalar<char[N]>, public array_info_scalar<char[N]>
#include <numpy.h>
template<size_t N>
struct array_info<std::array<char, N>> : public array_info_scalar<std::array<char, N>>, public array_info_scalar<std::array<char, N>>
#include <numpy.h>
template<typename T, size_t N>
struct array_info<std::array<T, N>>
#include <numpy.h>

Subclassed by array_info< T[N]>, array_info< T[N]>

Public Types

using type = typename array_info<T>::type
using type = typename array_info<T>::type

Public Static Functions

static inline void append_extents(list &shape)
static inline void append_extents(list &shape)

Public Static Attributes

static constexpr bool is_array = true
static constexpr bool is_empty = (N == 0) || array_info<T>::is_empty
static constexpr size_t extent = N
static constexpr auto extents = _<array_info<T>::is_array>(concat(_<N>(), array_info<T>::extents), _<N>())
template<typename T, size_t N>
struct array_info<T[N]> : public array_info<std::array<T, N>>, public array_info<std::array<T, N>>
#include <numpy.h>
template<typename T>
struct array_info_scalar
#include <numpy.h>

Subclassed by array_info< T >, array_info< T >

Public Types

typedef T type
typedef T type

Public Static Functions

static inline void append_extents(list&)
static inline void append_extents(list&)

Public Static Attributes

static constexpr bool is_array = false
static constexpr bool is_empty = false
static constexpr auto extents = _("")
template<typename T, int ExtraFlags = array::forcecast>
class array_t : public array, public array
#include <numpy.h>

Public Types

using value_type = T
using value_type = T

Public Functions

inline array_t()
inline array_t(handle h, borrowed_t)
inline array_t(handle h, stolen_t)
inline array_t(handle h, bool is_borrowed)
inline array_t(const object &o)
inline explicit array_t(const buffer_info &info)
inline array_t(ShapeContainer shape, StridesContainer strides, const T *ptr = nullptr, handle base = handle())
inline explicit array_t(ShapeContainer shape, const T *ptr = nullptr, handle base = handle())
inline explicit array_t(size_t count, const T *ptr = nullptr, handle base = handle())
inline constexpr ssize_t itemsize() const
template<typename ...Ix>
inline ssize_t index_at(Ix... index) const
template<typename ...Ix>
inline const T *data(Ix... index) const
template<typename ...Ix>
inline T *mutable_data(Ix... index)
template<typename ...Ix>
inline const T &at(Ix... index) const
template<typename ...Ix>
inline T &mutable_at(Ix... index)
template<ssize_t Dims = -1>
inline detail::unchecked_mutable_reference<T, Dims> mutable_unchecked() &

Returns a proxy object that provides access to the array’s data without bounds or dimensionality checking.

Will throw if the array is missing the writeable flag. Use with care: the array must not be destroyed or reshaped for the duration of the returned object, and the caller must take care not to access invalid dimensions or dimension indices.

template<ssize_t Dims = -1>
inline detail::unchecked_reference<T, Dims> unchecked() const &

Returns a proxy object that provides const access to the array’s data without bounds or dimensionality checking.

Unlike unchecked(), this does not require that the underlying array have the writable flag. Use with care: the array must not be destroyed or reshaped for the duration of the returned object, and the caller must take care not to access invalid dimensions or dimension indices.

inline array_t()
inline array_t(handle h, borrowed_t)
inline array_t(handle h, stolen_t)
inline array_t(handle h, bool is_borrowed)
inline array_t(const object &o)
inline explicit array_t(const buffer_info &info)
inline array_t(ShapeContainer shape, StridesContainer strides, const T *ptr = nullptr, handle base = handle())
inline explicit array_t(ShapeContainer shape, const T *ptr = nullptr, handle base = handle())
inline explicit array_t(size_t count, const T *ptr = nullptr, handle base = handle())
inline constexpr ssize_t itemsize() const
template<typename ...Ix>
inline ssize_t index_at(Ix... index) const
template<typename ...Ix>
inline const T *data(Ix... index) const
template<typename ...Ix>
inline T *mutable_data(Ix... index)
template<typename ...Ix>
inline const T &at(Ix... index) const
template<typename ...Ix>
inline T &mutable_at(Ix... index)
template<ssize_t Dims = -1>
inline detail::unchecked_mutable_reference<T, Dims> mutable_unchecked() &

Returns a proxy object that provides access to the array’s data without bounds or dimensionality checking.

Will throw if the array is missing the writeable flag. Use with care: the array must not be destroyed or reshaped for the duration of the returned object, and the caller must take care not to access invalid dimensions or dimension indices.

template<ssize_t Dims = -1>
inline detail::unchecked_reference<T, Dims> unchecked() const &

Returns a proxy object that provides const access to the array’s data without bounds or dimensionality checking.

Unlike unchecked(), this does not require that the underlying array have the writable flag. Use with care: the array must not be destroyed or reshaped for the duration of the returned object, and the caller must take care not to access invalid dimensions or dimension indices.

Public Static Functions

static inline array_t ensure(handle h)

Ensure that the argument is a NumPy array of the correct dtype (and if not, try to convert it).

In case of an error, nullptr is returned and the Python error is cleared.

static inline bool check_(handle h)
static inline array_t ensure(handle h)

Ensure that the argument is a NumPy array of the correct dtype (and if not, try to convert it).

In case of an error, nullptr is returned and the Python error is cleared.

static inline bool check_(handle h)

Protected Static Functions

static inline PyObject *raw_array_t(PyObject *ptr)

Create array from any object always returns a new reference.

static inline PyObject *raw_array_t(PyObject *ptr)

Create array from any object always returns a new reference.

Private Functions

inline array_t(private_ctor, ShapeContainer &&shape, StridesContainer &&strides, const T *ptr, handle base)
inline array_t(private_ctor, ShapeContainer &&shape, StridesContainer &&strides, const T *ptr, handle base)
template<typename T>
struct arrow_proxy
#include <pytypes.h>

Quick proxy class needed to implement operator-> for iterators which can’t return pointers.

Public Functions

inline arrow_proxy(T &&value)
inline T *operator->() const
inline arrow_proxy(T &&value)
inline T *operator->() const

Public Members

T value
class testing::internal::AssertHelper
#include <gtest.h>

Public Functions

AssertHelper(TestPartResult::Type type, const char *file, int line, const char *message)
~AssertHelper()
void operator=(const Message &message) const
AssertHelper(TestPartResult::Type type, const char *file, int line, const char *message)
~AssertHelper()
void operator=(const Message &message) const

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper)
GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper)

Private Members

AssertHelperData *const data_
struct testing::internal::AssertHelper::AssertHelperData

Public Functions

inline AssertHelperData(TestPartResult::Type t, const char *srcfile, int line_num, const char *msg)
inline AssertHelperData(TestPartResult::Type t, const char *srcfile, int line_num, const char *msg)

Public Members

TestPartResult::Type const type
const char *const file
int const line
std::string const message

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData)
GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData)
class AssertionResult
template<typename T1, typename T2>
class testing::internal::AssignAction
#include <gmock-actions.h>

Public Functions

inline AssignAction(T1 *ptr, T2 value)
template<typename Result, typename ArgumentTuple>
inline void Perform(const ArgumentTuple&) const
inline AssignAction(T1 *ptr, T2 value)
template<typename Result, typename ArgumentTuple>
inline void Perform(const ArgumentTuple&) const

Private Members

T1 *const ptr_
const T2 value_
class BarEnvironment : public testing::Environment

Public Functions

inline virtual void SetUp() override
inline virtual void TearDown() override
class testing::internal::Base

Public Functions

inline Base()
inline explicit Base(int n)
Base(const Base&) = default
Base &operator=(const Base&) = default
inline virtual ~Base()
inline int member()

Private Members

int member_
class Base

Public Functions

inline explicit Base(int an_x)
inline int x() const

Private Members

int x_
template<typename T>
struct base
#include <attr.h>

Annotation indicating that a class derives from another given type.

Public Functions

inline base()
inline base()
struct testing::gtest_printers_test::Big

Public Functions

inline Big()

Public Members

char array[257]
class BiggestIntConvertible

Public Functions

inline operator ::testing::internal::BiggestInt() const
struct Bool

Public Functions

inline explicit Bool(int val)
inline bool operator>(int n) const
inline Bool operator+(const Bool &rhs) const
inline bool operator==(const Bool &rhs) const

Public Members

bool value
class bool_ : public object, public object
#include <pytypes.h>

Public Functions

inline bool_()
inline bool_(bool value)
inline operator bool() const
inline bool_()
inline bool_(bool value)
inline operator bool() const

Private Static Functions

static inline PyObject *raw_bool(PyObject *op)

Return the truth value of an object always returns a new reference.

static inline PyObject *raw_bool(PyObject *op)

Return the truth value of an object always returns a new reference.

class testing::gmock_more_actions_test::BoolResetter

Public Functions

inline explicit BoolResetter(bool *value)
inline ~BoolResetter()

Private Members

bool *value_
template<bool...>
struct bools
#include <common.h>

Compile-time all/any/none of that check the boolean value of all template types.

struct borrowed_t
#include <pytypes.h>
class testing::internal::BriefUnitTestResultPrinter : public testing::TestEventListener

Public Functions

inline BriefUnitTestResultPrinter()
inline virtual void OnTestProgramStart(const UnitTest&) override
inline virtual void OnTestIterationStart(const UnitTest&, int) override
inline virtual void OnEnvironmentsSetUpStart(const UnitTest&) override
inline virtual void OnEnvironmentsSetUpEnd(const UnitTest&) override
inline virtual void OnTestCaseStart(const TestCase&) override
inline virtual void OnTestStart(const TestInfo&) override
virtual void OnTestPartResult(const TestPartResult &result) override
virtual void OnTestEnd(const TestInfo &test_info) override
inline virtual void OnTestCaseEnd(const TestCase&) override
inline virtual void OnEnvironmentsTearDownStart(const UnitTest&) override
inline virtual void OnEnvironmentsTearDownEnd(const UnitTest&) override
virtual void OnTestIterationEnd(const UnitTest &unit_test, int iteration) override
inline virtual void OnTestProgramEnd(const UnitTest&) override

Public Static Functions

static inline void PrintTestName(const char *test_suite, const char *test)
class buffer : public object, public object
#include <pytypes.h>

Subclassed by array, array

Public Functions

inline buffer_info request(bool writable = false) const
inline buffer_info request(bool writable = false) const
struct buffer_info
#include <buffer_info.h>

Information record describing a Python buffer object.

Public Functions

inline buffer_info()
inline buffer_info(void *ptr, ssize_t itemsize, const std::string &format, ssize_t ndim, detail::any_container<ssize_t> shape_in, detail::any_container<ssize_t> strides_in, bool readonly = false)
template<typename T>
inline buffer_info(T *ptr, detail::any_container<ssize_t> shape_in, detail::any_container<ssize_t> strides_in, bool readonly = false)
inline buffer_info(void *ptr, ssize_t itemsize, const std::string &format, ssize_t size, bool readonly = false)
template<typename T>
inline buffer_info(T *ptr, ssize_t size, bool readonly = false)
template<typename T>
inline buffer_info(const T *ptr, ssize_t size, bool readonly = true)
inline explicit buffer_info(Py_buffer *view, bool ownview = true)
buffer_info(const buffer_info&) = delete
buffer_info &operator=(const buffer_info&) = delete
inline buffer_info(buffer_info &&other)
inline buffer_info &operator=(buffer_info &&rhs)
inline ~buffer_info()
inline buffer_info()
inline buffer_info(void *ptr, ssize_t itemsize, const std::string &format, ssize_t ndim, detail::any_container<ssize_t> shape_in, detail::any_container<ssize_t> strides_in, bool readonly = false)
template<typename T>
inline buffer_info(T *ptr, detail::any_container<ssize_t> shape_in, detail::any_container<ssize_t> strides_in, bool readonly = false)
inline buffer_info(void *ptr, ssize_t itemsize, const std::string &format, ssize_t size, bool readonly = false)
template<typename T>
inline buffer_info(T *ptr, ssize_t size, bool readonly = false)
template<typename T>
inline buffer_info(const T *ptr, ssize_t size, bool readonly = true)
inline explicit buffer_info(Py_buffer *view, bool ownview = true)
buffer_info(const buffer_info&) = delete
buffer_info &operator=(const buffer_info&) = delete
inline buffer_info(buffer_info &&other)
inline buffer_info &operator=(buffer_info &&rhs)
inline ~buffer_info()

Public Members

void *ptr = nullptr
ssize_t itemsize = 0
ssize_t size = 0
std::string format
ssize_t ndim = 0
std::vector<ssize_t> shape
std::vector<ssize_t> strides
bool readonly = false

Private Functions

inline buffer_info(private_ctr_tag, void *ptr, ssize_t itemsize, const std::string &format, ssize_t ndim, detail::any_container<ssize_t> &&shape_in, detail::any_container<ssize_t> &&strides_in, bool readonly)
inline buffer_info(private_ctr_tag, void *ptr, ssize_t itemsize, const std::string &format, ssize_t ndim, detail::any_container<ssize_t> &&shape_in, detail::any_container<ssize_t> &&strides_in, bool readonly)

Private Members

Py_buffer *view = nullptr
bool ownview = false
struct buffer_protocol
#include <attr.h>

Annotation which enables the buffer protocol for a type.

class builtin_exception : public runtime_error, public runtime_error
#include <common.h>

C++ bindings of builtin Python exceptions.

Public Functions

virtual void set_error() const = 0

Set the error using the Python C API.

virtual void set_error() const = 0

Set the error using the Python C API.

template<typename T>
class testing::internal::BuiltInDefaultValue
#include <gmock-actions.h>

Public Static Functions

static inline bool Exists()
static inline T Get()
static inline bool Exists()
static inline T Get()
template<typename T>
class testing::internal::BuiltInDefaultValue<const T>
#include <gmock-actions.h>

Public Static Functions

static inline bool Exists()
static inline T Get()
static inline bool Exists()
static inline T Get()
template<typename T>
class testing::internal::BuiltInDefaultValue<T*>
#include <gmock-actions.h>

Public Static Functions

static inline bool Exists()
static inline T *Get()
static inline bool Exists()
static inline T *Get()
template<typename T, bool kDefaultConstructible>
struct testing::internal::BuiltInDefaultValueGetter
#include <gmock-actions.h>

Public Static Functions

static inline T Get()
static inline T Get()
template<typename T>
struct testing::internal::BuiltInDefaultValueGetter<T, false>
#include <gmock-actions.h>

Public Static Functions

static inline T Get()
static inline T Get()
template<typename T>
struct testing::internal::ByMoveWrapper
#include <gmock-actions.h>

Public Functions

inline explicit ByMoveWrapper(T value)
inline explicit ByMoveWrapper(T value)

Public Members

T payload
class bytes : public object, public object
#include <pytypes.h>

Public Functions

inline bytes(const char *c = "")
inline bytes(const char *c, size_t n)
inline bytes(const std::string &s)
inline explicit bytes(const pybind11::str &s)
inline operator std::string() const
inline bytes(const char *c = "")
inline bytes(const char *c, size_t n)
inline bytes(const std::string &s)
explicit bytes(const pybind11::str &s)
inline operator std::string() const
template<typename ...Ts>
struct call_guard
#include <attr.h>

A call policy which places one or more guard variables (Ts...) around the function call.

For example, this definition:

.. code-block:: cpp

m.def("foo", foo, py::call_guard<T>());

is equivalent to the following pseudocode:

.. code-block:: cpp

m.def("foo", [](args...) {
    T scope_guard;
    return foo(args...); // forwarded arguments
});

template<typename T>
struct call_guard<T>
#include <attr.h>

Public Types

using type = T
using type = T
template<typename T, typename ...Ts>
struct call_guard<T, Ts...>
#include <attr.h>
template<>
struct call_guard<>
#include <attr.h>

Public Types

using type = detail::void_type
using type = detail::void_type
class testing::gmock_nice_strict_test::CallsMockMethodInDestructor

Public Functions

inline ~CallsMockMethodInDestructor()
MOCK_METHOD (void, OnDestroy,())
class capsule : public object, public object
#include <pytypes.h>

Public Functions

PYBIND11_DEPRECATED ("Use reinterpret_borrow<capsule>() or reinterpret_steal<capsule>()") capsule(PyObject *ptr
PYBIND11_DEPRECATED ("Use reinterpret_borrow<capsule>() or reinterpret_steal<capsule>()") capsule(PyObject *ptr

Public Members

bool is_borrowed
class testing::internal::Castable

Public Functions

inline explicit Castable(bool *converted)
inline operator Base()

Private Members

bool *converted_
class ChildClassWithoutStreamOperator : public ParentClass
class ChildClassWithStreamOperator : public ParentClass
template<typename type_, typename ...options>
class class_ : public generic_type, public generic_type
#include <pybind11.h>

Public Types

using type = type_
using type_alias = detail::exactly_one_t<is_subtype, void, options...>
using holder_type = detail::exactly_one_t<is_holder, std::unique_ptr<type>, options...>
using type = type_
using type_alias = detail::exactly_one_t<is_subtype, void, options...>
using holder_type = detail::exactly_one_t<is_holder, std::unique_ptr<type>, options...>

Public Functions

template<typename ...Extra>
inline class_(handle scope, const char *name, const Extra&... extra)
template<typename Func, typename ...Extra>
inline class_ &def(const char *name_, Func &&f, const Extra&... extra)
template<typename Func, typename ...Extra>
inline class_ &def_static(const char *name_, Func &&f, const Extra&... extra)
template<detail::op_id id, detail::op_type ot, typename L, typename R, typename ...Extra>
inline class_ &def(const detail::op_<id, ot, L, R> &op, const Extra&... extra)
template<detail::op_id id, detail::op_type ot, typename L, typename R, typename ...Extra>
inline class_ &def_cast(const detail::op_<id, ot, L, R> &op, const Extra&... extra)
template<typename ...Args, typename ...Extra>
inline class_ &def(const detail::initimpl::constructor<Args...> &init, const Extra&... extra)
template<typename ...Args, typename ...Extra>
inline class_ &def(const detail::initimpl::alias_constructor<Args...> &init, const Extra&... extra)
template<typename ...Args, typename ...Extra>
inline class_ &def(detail::initimpl::factory<Args...> &&init, const Extra&... extra)
template<typename ...Args, typename ...Extra>
inline class_ &def(detail::initimpl::pickle_factory<Args...> &&pf, const Extra&... extra)
template<typename Func>
inline class_ &def_buffer(Func &&func)
template<typename Return, typename Class, typename ...Args>
inline class_ &def_buffer(Return (Class::* func)(Args...))
template<typename Return, typename Class, typename ...Args>
inline class_ &def_buffer(Return (Class::* func)(Args...) const)
template<typename C, typename D, typename ...Extra>
inline class_ &def_readwrite(const char *name, D C::* pm, const Extra&... extra)
template<typename C, typename D, typename ...Extra>
inline class_ &def_readonly(const char *name, const D C::* pm, const Extra&... extra)
template<typename D, typename ...Extra>
inline class_ &def_readwrite_static(const char *name, D *pm, const Extra&... extra)
template<typename D, typename ...Extra>
inline class_ &def_readonly_static(const char *name, const D *pm, const Extra&... extra)
template<typename Getter, typename ...Extra>
inline class_ &def_property_readonly(const char *name, const Getter &fget, const Extra&... extra)

Uses return_value_policy::reference_internal by default.

template<typename ...Extra>
inline class_ &def_property_readonly(const char *name, const cpp_function &fget, const Extra&... extra)

Uses cpp_function’s return_value_policy by default.

template<typename Getter, typename ...Extra>
inline class_ &def_property_readonly_static(const char *name, const Getter &fget, const Extra&... extra)

Uses return_value_policy::reference by default.

template<typename ...Extra>
inline class_ &def_property_readonly_static(const char *name, const cpp_function &fget, const Extra&... extra)

Uses cpp_function’s return_value_policy by default.

template<typename Getter, typename Setter, typename ...Extra>
inline class_ &def_property(const char *name, const Getter &fget, const Setter &fset, const Extra&... extra)

Uses return_value_policy::reference_internal by default.

template<typename Getter, typename ...Extra>
inline class_ &def_property(const char *name, const Getter &fget, const cpp_function &fset, const Extra&... extra)
template<typename ...Extra>
inline class_ &def_property(const char *name, const cpp_function &fget, const cpp_function &fset, const Extra&... extra)

Uses cpp_function’s return_value_policy by default.

template<typename Getter, typename ...Extra>
inline class_ &def_property_static(const char *name, const Getter &fget, const cpp_function &fset, const Extra&... extra)

Uses return_value_policy::reference by default.

template<typename ...Extra>
inline class_ &def_property_static(const char *name, const cpp_function &fget, const cpp_function &fset, const Extra&... extra)

Uses cpp_function’s return_value_policy by default.

template<typename ...Extra>
inline class_(handle scope, const char *name, const Extra&... extra)
template<typename Func, typename ...Extra>
inline class_ &def(const char *name_, Func &&f, const Extra&... extra)
template<typename Func, typename ...Extra>
inline class_ &def_static(const char *name_, Func &&f, const Extra&... extra)
template<detail::op_id id, detail::op_type ot, typename L, typename R, typename ...Extra>
inline class_ &def(const detail::op_<id, ot, L, R> &op, const Extra&... extra)
template<detail::op_id id, detail::op_type ot, typename L, typename R, typename ...Extra>
inline class_ &def_cast(const detail::op_<id, ot, L, R> &op, const Extra&... extra)
template<typename ...Args, typename ...Extra>
inline class_ &def(const detail::initimpl::constructor<Args...> &init, const Extra&... extra)
template<typename ...Args, typename ...Extra>
inline class_ &def(const detail::initimpl::alias_constructor<Args...> &init, const Extra&... extra)
template<typename ...Args, typename ...Extra>
inline class_ &def(detail::initimpl::factory<Args...> &&init, const Extra&... extra)
template<typename ...Args, typename ...Extra>
inline class_ &def(detail::initimpl::pickle_factory<Args...> &&pf, const Extra&... extra)
template<typename Func>
inline class_ &def_buffer(Func &&func)
template<typename Return, typename Class, typename ...Args>
inline class_ &def_buffer(Return (Class::* func)(Args...))
template<typename Return, typename Class, typename ...Args>
inline class_ &def_buffer(Return (Class::* func)(Args...) const)
template<typename C, typename D, typename ...Extra>
inline class_ &def_readwrite(const char *name, D C::* pm, const Extra&... extra)
template<typename C, typename D, typename ...Extra>
inline class_ &def_readonly(const char *name, const D C::* pm, const Extra&... extra)
template<typename D, typename ...Extra>
inline class_ &def_readwrite_static(const char *name, D *pm, const Extra&... extra)
template<typename D, typename ...Extra>
inline class_ &def_readonly_static(const char *name, const D *pm, const Extra&... extra)
template<typename Getter, typename ...Extra>
inline class_ &def_property_readonly(const char *name, const Getter &fget, const Extra&... extra)

Uses return_value_policy::reference_internal by default.

template<typename ...Extra>
inline class_ &def_property_readonly(const char *name, const cpp_function &fget, const Extra&... extra)

Uses cpp_function’s return_value_policy by default.

template<typename Getter, typename ...Extra>
inline class_ &def_property_readonly_static(const char *name, const Getter &fget, const Extra&... extra)

Uses return_value_policy::reference by default.

template<typename ...Extra>
inline class_ &def_property_readonly_static(const char *name, const cpp_function &fget, const Extra&... extra)

Uses cpp_function’s return_value_policy by default.

template<typename Getter, typename Setter, typename ...Extra>
inline class_ &def_property(const char *name, const Getter &fget, const Setter &fset, const Extra&... extra)

Uses return_value_policy::reference_internal by default.

template<typename Getter, typename ...Extra>
inline class_ &def_property(const char *name, const Getter &fget, const cpp_function &fset, const Extra&... extra)
template<typename ...Extra>
inline class_ &def_property(const char *name, const cpp_function &fget, const cpp_function &fset, const Extra&... extra)

Uses cpp_function’s return_value_policy by default.

template<typename Getter, typename ...Extra>
inline class_ &def_property_static(const char *name, const Getter &fget, const cpp_function &fset, const Extra&... extra)

Uses return_value_policy::reference by default.

template<typename ...Extra>
inline class_ &def_property_static(const char *name, const cpp_function &fget, const cpp_function &fset, const Extra&... extra)

Uses cpp_function’s return_value_policy by default.

Public Static Functions

template<typename Base, detail::enable_if_t<is_base<Base>::value, int> = 0>
static inline void add_base(detail::type_record &rec)
template<typename Base, detail::enable_if_t<!is_base<Base>::value, int> = 0>
static inline void add_base(detail::type_record&)
template<typename Base, detail::enable_if_t<is_base<Base>::value, int> = 0>
static inline void add_base(detail::type_record &rec)
template<typename Base, detail::enable_if_t<!is_base<Base>::value, int> = 0>
static inline void add_base(detail::type_record&)

Public Static Attributes

static constexpr bool has_alias = !std::is_void<type_alias>::value

Private Types

using is_holder = detail::is_holder_type<type_, T>
using is_subtype = detail::is_strict_base_of<type_, T>
using is_base = detail::is_strict_base_of<T, type_>
using is_holder = detail::is_holder_type<type_, T>
using is_subtype = detail::is_strict_base_of<type_, T>
using is_base = detail::is_strict_base_of<T, type_>

Private Static Functions

template<typename T>
static inline void init_holder(detail::instance *inst, detail::value_and_holder &v_h, const holder_type*, const std::enable_shared_from_this<T>*)

Initialize holder object, variant 1: object derives from enable_shared_from_this.

static inline void init_holder_from_existing(const detail::value_and_holder &v_h, const holder_type *holder_ptr, std::true_type)
static inline void init_holder_from_existing(const detail::value_and_holder &v_h, const holder_type *holder_ptr, std::false_type)
static inline void init_holder(detail::instance *inst, detail::value_and_holder &v_h, const holder_type *holder_ptr, const void*)

Initialize holder object, variant 2: try to construct from existing holder object, if possible.

static inline void init_instance(detail::instance *inst, const void *holder_ptr)

Performs instance initialization including constructing a holder and registering the known instance.

Should be called as soon as the type value_ptr is set for an instance. Takes an optional pointer to an existing holder to use; if not specified and the instance is .owned, a new holder will be constructed to manage the value pointer.

static inline void dealloc(detail::value_and_holder &v_h)

Deallocates an instance; via holder, if constructed; otherwise via operator delete.

static inline detail::function_record *get_function_record(handle h)
template<typename T>
static inline void init_holder(detail::instance *inst, detail::value_and_holder &v_h, const holder_type*, const std::enable_shared_from_this<T>*)

Initialize holder object, variant 1: object derives from enable_shared_from_this.

static inline void init_holder_from_existing(const detail::value_and_holder &v_h, const holder_type *holder_ptr, std::true_type)
static inline void init_holder_from_existing(const detail::value_and_holder &v_h, const holder_type *holder_ptr, std::false_type)
static inline void init_holder(detail::instance *inst, detail::value_and_holder &v_h, const holder_type *holder_ptr, const void*)

Initialize holder object, variant 2: try to construct from existing holder object, if possible.

static inline void init_instance(detail::instance *inst, const void *holder_ptr)

Performs instance initialization including constructing a holder and registering the known instance.

Should be called as soon as the type value_ptr is set for an instance. Takes an optional pointer to an existing holder to use; if not specified and the instance is .owned, a new holder will be constructed to manage the value pointer.

static inline void dealloc(detail::value_and_holder &v_h)

Deallocates an instance; via holder, if constructed; otherwise via operator delete.

static inline detail::function_record *get_function_record(handle h)
class CodeLocationForTESTF : public testing::Test
class CodeLocationForTESTP : public testing::TestWithParam<int>
template<typename T>
class CodeLocationForTYPEDTEST : public testing::Test
template<typename T>
class CodeLocationForTYPEDTESTP : public testing::Test
class CommentTest : public TestWithParam<Unstreamable>
class common_iterator
#include <numpy.h>

Public Types

using container_type = std::vector<ssize_t>
using value_type = container_type::value_type
using size_type = container_type::size_type
using container_type = std::vector<ssize_t>
using value_type = container_type::value_type
using size_type = container_type::size_type

Public Functions

inline common_iterator()
inline common_iterator(void *ptr, const container_type &strides, const container_type &shape)
inline void increment(size_type dim)
inline void *data() const
inline common_iterator()
inline common_iterator(void *ptr, const container_type &strides, const container_type &shape)
inline void increment(size_type dim)
inline void *data() const

Private Members

char *p_ptr
container_type m_strides
template<typename T>
class CommonTest : public testing::Test

Subclassed by DerivedTest< T >

Public Static Functions

static inline void SetUpTestSuite()
static inline void TearDownTestSuite()

Protected Types

typedef std::vector<T> Vector
typedef std::set<int> IntSet

Protected Functions

inline CommonTest()
inline ~CommonTest() override
inline virtual void SetUp() override
inline virtual void TearDown() override

Protected Attributes

T value_

Protected Static Attributes

static T *shared_ = nullptr
template<typename T, typename SFINAE = void>
struct compare_buffer_info
#include <buffer_info.h>

Public Static Functions

static inline bool compare(const buffer_info &b)
static inline bool compare(const buffer_info &b)
template<typename T>
struct compare_buffer_info<T, detail::enable_if_t<detail::is_pod_struct<T>::value>>
#include <numpy.h>

Public Static Functions

static inline bool compare(const buffer_info &b)
static inline bool compare(const buffer_info &b)
template<typename T>
struct compare_buffer_info<T, detail::enable_if_t<std::is_integral<T>::value>>
#include <buffer_info.h>

Public Static Functions

static inline bool compare(const buffer_info &b)
static inline bool compare(const buffer_info &b)
struct testing::gtest_printers_test::const_iterator

Public Members

char x
struct ConstOnlyContainerWithClassIterator::const_iterator

Public Functions

const int &operator*() const
const_iterator &operator++()
class testing::internal::ConstAndNonConstCastable

Public Functions

inline ConstAndNonConstCastable(bool *converted, bool *const_converted)
inline operator Base()
inline operator Base() const

Private Members

bool *converted_
bool *const_converted_
class testing::internal::ConstCastable

Public Functions

inline explicit ConstCastable(bool *converted)
inline operator Base() const

Private Members

bool *converted_
struct ConstOnlyContainerWithClassIterator

Public Functions

const_iterator begin() const
const_iterator end() const
struct ConstOnlyContainerWithPointerIterator

Public Types

using const_iterator = int*

Public Functions

const_iterator begin() const
const_iterator end() const
struct ConstructionCounting

Public Functions

inline ConstructionCounting()
inline ~ConstructionCounting()
inline ConstructionCounting(const ConstructionCounting&)
inline ConstructionCounting(ConstructionCounting&&) noexcept
inline ConstructionCounting &operator=(const ConstructionCounting&)
inline ConstructionCounting &operator=(ConstructionCounting&&) noexcept

Public Static Functions

static inline void Reset()

Public Static Attributes

static int default_ctor_calls = 0
static int dtor_calls = 0
static int copy_ctor_calls = 0
static int move_ctor_calls = 0
static int copy_assignment_calls = 0
static int move_assignment_calls = 0
template<typename ...Args>
struct constructor
#include <init.h>

Public Static Functions

template<typename Class, typename ...Extra, enable_if_t<!Class::has_alias, int> = 0>
static inline void execute(Class &cl, const Extra&... extra)
template<typename Class, typename ...Extra, enable_if_t<Class::has_alias && std::is_constructible<Cpp<Class>, Args...>::value, int> = 0>
static inline void execute(Class &cl, const Extra&... extra)
template<typename Class, typename ...Extra, enable_if_t<Class::has_alias && !std::is_constructible<Cpp<Class>, Args...>::value, int> = 0>
static inline void execute(Class &cl, const Extra&... extra)
template<typename Class, typename ...Extra, enable_if_t<!Class::has_alias, int> = 0>
static inline void execute(Class &cl, const Extra&... extra)
template<typename Class, typename ...Extra, enable_if_t<Class::has_alias && std::is_constructible<Cpp<Class>, Args...>::value, int> = 0>
static inline void execute(Class &cl, const Extra&... extra)
template<typename Class, typename ...Extra, enable_if_t<Class::has_alias && !std::is_constructible<Cpp<Class>, Args...>::value, int> = 0>
static inline void execute(Class &cl, const Extra&... extra)
template<typename T>
struct container_traits
#include <stl_bind.h>

Public Static Functions

template<typename T2>
static std::true_type test_comparable(decltype(std::declval<const T2&>() == std::declval<const T2&>())*)
template<typename T2>
static std::false_type test_comparable(...)
template<typename T2>
static std::true_type test_value(typename T2::value_type*)
template<typename T2>
static std::false_type test_value(...)
template<typename T2>
static std::true_type test_pair(typename T2::first_type*, typename T2::second_type*)
template<typename T2>
static std::false_type test_pair(...)
template<typename T2>
static std::true_type test_comparable(decltype(std::declval<const T2&>() == std::declval<const T2&>())*)
template<typename T2>
static std::false_type test_comparable(...)
template<typename T2>
static std::true_type test_value(typename T2::value_type*)
template<typename T2>
static std::false_type test_value(...)
template<typename T2>
static std::true_type test_pair(typename T2::first_type*, typename T2::second_type*)
template<typename T2>
static std::false_type test_pair(...)

Public Static Attributes

static constexpr const bool is_comparable = std::is_same<std::true_type, decltype(test_comparable<T>(nullptr))>::value
static constexpr const bool is_pair = std::is_same<std::true_type, decltype(test_pair<T>(nullptr, nullptr))>::value
static constexpr const bool is_vector = std::is_same<std::true_type, decltype(test_value<T>(nullptr))>::value
static constexpr const bool is_element = !is_pair && !is_vector
struct testing::internal::ContainerPrinter
#include <gtest-printers.h>

Public Static Functions

template<typename T, typename = typename std::enable_if<                (sizeof(IsContainerTest<T>(0)) == sizeof(IsContainer)) &&                !IsRecursiveContainer<T>::value>::type> static inline void PrintValue (const T &container, std::ostream *os)
template<typename T, typename = typename std::enable_if<                (sizeof(IsContainerTest<T>(0)) == sizeof(IsContainer)) &&                !IsRecursiveContainer<T>::value>::type> static inline void PrintValue (const T &container, std::ostream *os)
template<typename T>
class ContainerTest : public testing::Test
#include <gtest-typed-test_test.h>
class ConversionHelperBase

Subclassed by ConversionHelperDerived

class ConversionHelperDerived : public ConversionHelperBase
template<class Scalar, int Rows, int Cols, int Align, int RowsAtCompileTime, int ColsAtCompileTime>
struct YAML::convert<Eigen::Matrix<Scalar, Rows, Cols, Align, RowsAtCompileTime, ColsAtCompileTime>>
#include <yaml_eigen.hpp>

Public Static Functions

static inline Node encode(const Eigen_Type_ &rhs)
static inline bool decode_2d(const Node &node, Eigen_Type_ &rhs)
static inline bool decode_1d(const Node &node, Eigen_Type_ &rhs)
static inline bool decode(const Node &node, Eigen_Type_ &rhs)
static inline Node encode(const Eigen_Type_ &rhs)
static inline bool decode_2d(const Node &node, Eigen_Type_ &rhs)
static inline bool decode_1d(const Node &node, Eigen_Type_ &rhs)
static inline bool decode(const Node &node, Eigen_Type_ &rhs)

Public Static Attributes

static const bool is_vector_type_ = Rows == 1 || Cols == 1
template<>
struct YAML::convert<Eigen::Quaterniond>
#include <yaml_eigen.hpp>

Public Static Functions

static inline Node encode(const Eigen::Quaterniond &mp)
static inline bool decode(const Node &node, Eigen::Quaterniond &mp)
static inline Node encode(const Eigen::Quaterniond &mp)
static inline bool decode(const Node &node, Eigen::Quaterniond &mp)
template<class T>
struct YAML::convert<robot_math::MovableEigenVector<T>>
#include <yaml_eigen.hpp>

Public Static Functions

static inline Node encode(const robot_math::MovableEigenVector<T> &mp)
static inline bool decode(const Node &node, robot_math::MovableEigenVector<T> &mp)
static inline Node encode(const robot_math::MovableEigenVector<T> &mp)
static inline bool decode(const Node &node, robot_math::MovableEigenVector<T> &mp)
struct ConvertibleToAssertionResult

Public Functions

inline operator AssertionResult() const
struct testing::internal::ConvertibleToIntegerPrinter
#include <gtest-printers.h>

Public Static Functions

static inline void PrintValue(internal::BiggestInt value, ::std::ostream *os)
static inline void PrintValue(internal::BiggestInt value, ::std::ostream *os)
struct ConvertibleToStringViewPrinter
#include <gtest-printers.h>
template<typename type, typename holder_type>
struct copyable_holder_caster : public type_caster_base<type>, public type_caster_base<type>
#include <cast.h>

Type caster for holder types like std::shared_ptr, etc.

Public Types

using base = type_caster_base<type>
using base = type_caster_base<type>

Public Functions

inline bool load(handle src, bool convert)
inline explicit operator type*()
inline explicit operator type&()
inline explicit operator holder_type*()
inline explicit operator holder_type&()
inline bool load(handle src, bool convert)
inline explicit operator type*()
inline explicit operator type&()
inline explicit operator holder_type*()
inline explicit operator holder_type&()

Public Static Functions

static inline handle cast(const holder_type &src, return_value_policy, handle)
static inline handle cast(const holder_type &src, return_value_policy, handle)

Protected Functions

inline void check_holder_compat()
inline bool load_value(value_and_holder &&v_h)
template<typename T = holder_type, detail::enable_if_t<!std::is_constructible<T, const T&, type*>::value, int> = 0>
inline bool try_implicit_casts(handle, bool)
template<typename T = holder_type, detail::enable_if_t<std::is_constructible<T, const T&, type*>::value, int> = 0>
inline bool try_implicit_casts(handle src, bool convert)
inline void check_holder_compat()
inline bool load_value(value_and_holder &&v_h)
template<typename T = holder_type, detail::enable_if_t<!std::is_constructible<T, const T&, type*>::value, int> = 0>
inline bool try_implicit_casts(handle, bool)
template<typename T = holder_type, detail::enable_if_t<std::is_constructible<T, const T&, type*>::value, int> = 0>
inline bool try_implicit_casts(handle src, bool convert)

Protected Attributes

holder_type holder

Protected Static Functions

static inline bool try_direct_conversions(handle)
static inline bool try_direct_conversions(handle)

Friends

friend class type_caster_generic
class Counter
#include <sample4.h>

Public Functions

inline Counter()
int Increment()
int Decrement()
void Print() const

Private Members

int counter_
class cpp_function : public function, public function
#include <pybind11.h>

Wraps an arbitrary C++ function/method/lambda function/.. into a callable Python object.

Public Functions

inline cpp_function()
inline cpp_function(std::nullptr_t)
template<typename Return, typename ...Args, typename ...Extra>
inline cpp_function(Return (*f)(Args...), const Extra&... extra, )

Construct a cpp_function from a vanilla function pointer.

template<typename Func, typename ...Extra, typename = detail::enable_if_t<detail::is_lambda<Func>::value>>
inline cpp_function(Func &&f, const Extra&... extra)

Construct a cpp_function from a lambda function (possibly with internal state)

template<typename Return, typename Class, typename ...Arg, typename ...Extra>
inline cpp_function(Return (Class::* f)(Arg...), const Extra&... extra, )

Construct a cpp_function from a class method (non-const)

template<typename Return, typename Class, typename ...Arg, typename ...Extra>
inline cpp_function(Return (Class::* f)(Arg...) const, const Extra&... extra, )

Construct a cpp_function from a class method (const)

inline object name() const

Return the function name.

inline cpp_function()
inline cpp_function(std::nullptr_t)
template<typename Return, typename ...Args, typename ...Extra>
inline cpp_function(Return (*f)(Args...), const Extra&... extra, )

Construct a cpp_function from a vanilla function pointer.

template<typename Func, typename ...Extra, typename = detail::enable_if_t<detail::is_lambda<Func>::value>>
inline cpp_function(Func &&f, const Extra&... extra)

Construct a cpp_function from a lambda function (possibly with internal state)

template<typename Return, typename Class, typename ...Arg, typename ...Extra>
inline cpp_function(Return (Class::* f)(Arg...), const Extra&... extra, )

Construct a cpp_function from a class method (non-const)

template<typename Return, typename Class, typename ...Arg, typename ...Extra>
inline cpp_function(Return (Class::* f)(Arg...) const, const Extra&... extra, )

Construct a cpp_function from a class method (const)

inline object name() const

Return the function name.

Protected Functions

inline PYBIND11_NOINLINE detail::function_record * make_function_record ()

Space optimization: don’t inline this frequently instantiated fragment.

template<typename Func, typename Return, typename ...Args, typename ...Extra>
inline void initialize(Func &&f, Return (*)(Args...), const Extra&... extra, )

Special internal constructor for functors, lambda functions, etc.

inline void initialize_generic(detail::function_record *rec, const char *text, const std::type_info *const *types, size_t args)

Register a function call with Python (generic non-templated code goes here)

inline PYBIND11_NOINLINE detail::function_record * make_function_record ()

Space optimization: don’t inline this frequently instantiated fragment.

template<typename Func, typename Return, typename ...Args, typename ...Extra>
inline void initialize(Func &&f, Return (*)(Args...), const Extra&... extra, )

Special internal constructor for functors, lambda functions, etc.

inline void initialize_generic(detail::function_record *rec, const char *text, const std::type_info *const *types, size_t args)

Register a function call with Python (generic non-templated code goes here)

Protected Static Functions

static inline void destruct(detail::function_record *rec)

When a cpp_function is GCed, release any memory allocated by pybind11.

static inline PyObject *dispatcher(PyObject *self, PyObject *args_in, PyObject *kwargs_in)

Main dispatch logic for calls to functions bound using pybind11.

static inline void destruct(detail::function_record *rec)

When a cpp_function is GCed, release any memory allocated by pybind11.

static inline PyObject *dispatcher(PyObject *self, PyObject *args_in, PyObject *kwargs_in)

Main dispatch logic for calls to functions bound using pybind11.

class testing::CurrentTestInfoTest : public testing::Test

Protected Static Functions

static inline void SetUpTestSuite()
static inline void TearDownTestSuite()
class CustomFunctionNamingTest : public testing::TestWithParam<std::string>
class CustomFunctorNamingTest : public testing::TestWithParam<std::string>
class CustomIntegerNamingTest : public testing::TestWithParam<int>
class CustomLambdaNamingTest : public testing::TestWithParam<std::string>
struct CustomParamNameFunctor

Public Functions

inline std::string operator()(const ::testing::TestParamInfo<std::string> &inf)
struct CustomStruct

Public Functions

inline explicit CustomStruct(int value)

Public Members

int x
class CustomStructNamingTest : public TestWithParam<CustomStruct>
class package_template::Default_pid_factory

Use a PID factory for the unittests.

Public Static Functions

static inline PID &get()

PID controller factory.

Returns

PID& Return a reference to a newly created PID controller.

Public Static Attributes

static std::vector<std::shared_ptr<Gains_configuration>> configs_

The PID gains.

static std::vector<std::shared_ptr<PID>> controllers_

List of PID controllers.

class package_template::DefaultConfiguration : public package_template::Gains_configuration
#include <default_configuration.hpp>

Default configuration for the kp, kd, ki paramters.

This class initialize the PID gains as follow:

  • kp = DEFAULT_KP,

  • kd = DEFAULT_KD

  • ki = DEFAULT_KI

Public Functions

inline ~DefaultConfiguration()

Here we use the default destructor.

virtual double get_kp() const

Always returns DEFAULT_KP.

Returns

double DEFAULT_KP

virtual double get_kd() const

Always returns DEFAULT_KD.

Returns

double DEFAULT_KD

virtual double get_ki() const

Always returns DEFAULT_KI.

Returns

double DEFAULT_KI

virtual bool has_error() const

Always returns false.

Returns

true Never

Returns

false Always

virtual std::string get_error() const

Always returns “no error”.

Returns

std::string “no error”

template<typename T>
class testing::DefaultValue
#include <gmock-actions.h>

Public Types

typedef T (*FactoryFunction)()
typedef T (*FactoryFunction)()

Public Static Functions

static inline void Set(T x)
static inline void SetFactory(FactoryFunction factory)
static inline void Clear()
static inline bool IsSet()
static inline bool Exists()
static inline T Get()
static inline void Set(T x)
static inline void SetFactory(FactoryFunction factory)
static inline void Clear()
static inline bool IsSet()
static inline bool Exists()
static inline T Get()

Private Static Attributes

static ValueProducer *producer_ = nullptr
template<typename T>
class testing::DefaultValue<T&>
#include <gmock-actions.h>

Public Static Functions

static inline void Set(T &x)
static inline void Clear()
static inline bool IsSet()
static inline bool Exists()
static inline T &Get()
static inline void Set(T &x)
static inline void Clear()
static inline bool IsSet()
static inline bool Exists()
static inline T &Get()

Private Static Attributes

static T *address_
template<>
class testing::DefaultValue<void>
#include <gmock-actions.h>

Public Static Functions

static inline bool Exists()
static inline void Get()
static inline bool Exists()
static inline void Get()
template<typename T, typename...>
struct deferred_type
#include <common.h>

Defer the evaluation of type T until types Us are instantiated.

Public Types

using type = T
using type = T
template<size_t k>
struct testing::internal::DeleteArgAction
#include <gmock-actions.h>

Public Functions

template<typename ...Args>
inline void operator()(const Args&... args) const
template<typename ...Args>
inline void operator()(const Args&... args) const
class testing::gmock_more_actions_test::DeletionTester

Public Functions

inline explicit DeletionTester(bool *is_deleted)
inline ~DeletionTester()

Private Members

bool *is_deleted_
class testing::internal::Derived : public testing::internal::Base, public testing::internal::Base

Public Functions

inline explicit Derived(int n)
template<typename T>
class DerivedTest : public CommonTest<T>
template<size_t N, typename ...Ts>
struct descr
#include <descr.h>

Public Functions

inline constexpr descr()
inline constexpr descr(char const (&s)[N + 1])
template<size_t... Is>
inline constexpr descr(char const (&s)[N + 1], index_sequence<Is...>)
template<typename ...Chars>
inline constexpr descr(char c, Chars... cs)
inline constexpr descr()
inline constexpr descr(char const (&s)[N + 1])
template<size_t... Is>
inline constexpr descr(char const (&s)[N + 1], index_sequence<Is...>)
template<typename ...Chars>
inline constexpr descr(char c, Chars... cs)

Public Members

char text[N + 1]

Public Static Functions

static inline constexpr std::array<const std::type_info*, sizeof...(Ts) + 1> types()
static inline constexpr std::array<const std::type_info*, sizeof...(Ts) + 1> types()
class DetectNotInstantiatedTest : public testing::TestWithParam<int>
template<typename T>
class DetectNotInstantiatedTypesTest : public testing::Test
class dict : public object, public object
#include <pytypes.h>

Subclassed by kwargs, kwargs

Public Functions

inline dict()
template<typename ...Args, typename = detail::enable_if_t<detail::all_of<detail::is_keyword_or_ds<Args>...>::value>, typename collector = detail::deferred_t<detail::unpacking_collector<>, Args...>>
inline explicit dict(Args&&... args)
inline size_t size() const
inline bool empty() const
inline detail::dict_iterator begin() const
inline detail::dict_iterator end() const
inline void clear() const
template<typename T>
inline bool contains(T &&key) const
inline dict()
template<typename ...Args, typename = detail::enable_if_t<detail::all_of<detail::is_keyword_or_ds<Args>...>::value>, typename collector = detail::deferred_t<detail::unpacking_collector<>, Args...>>
inline explicit dict(Args&&... args)
inline size_t size() const
inline bool empty() const
inline detail::dict_iterator begin() const
inline detail::dict_iterator end() const
inline void clear() const
template<typename T>
inline bool contains(T &&key) const

Private Static Functions

static inline PyObject *raw_dict(PyObject *op)

Call the dict Python type always returns a new reference.

static inline PyObject *raw_dict(PyObject *op)

Call the dict Python type always returns a new reference.

class dict_readonly
#include <pytypes.h>

Python’s dictionary protocol permits this to be a forward iterator.

Protected Types

using iterator_category = std::forward_iterator_tag
using value_type = std::pair<handle, handle>
using reference = const value_type
using pointer = arrow_proxy<const value_type>
using iterator_category = std::forward_iterator_tag
using value_type = std::pair<handle, handle>
using reference = const value_type
using pointer = arrow_proxy<const value_type>

Protected Functions

dict_readonly() = default
inline dict_readonly(handle obj, ssize_t pos)
inline reference dereference() const
inline void increment()
inline bool equal(const dict_readonly &b) const
dict_readonly() = default
inline dict_readonly(handle obj, ssize_t pos)
inline reference dereference() const
inline void increment()
inline bool equal(const dict_readonly &b) const

Private Members

handle obj
PyObject *key = nullptr
PyObject *value = nullptr
ssize_t pos = -1
class DisabledTest : public Test
template<typename ...Actions>
struct testing::internal::DoAllAction
#include <gmock-actions.h>

Public Functions

template<typename R, typename ...Args>
inline operator Action<R(Args...)>() const
template<typename R, typename ...Args>
inline operator Action<R(Args...)>() const

Public Members

std::tuple<Actions...> actions

Private Types

using NonFinalType = typename std::conditional<std::is_scalar<T>::value, T, const T&>::type
using NonFinalType = typename std::conditional<std::is_scalar<T>::value, T, const T&>::type

Private Functions

template<typename ActionT, size_t... I>
inline std::vector<ActionT> Convert(IndexSequence<I...>) const
template<typename ActionT, size_t... I>
inline std::vector<ActionT> Convert(IndexSequence<I...>) const
struct doc
#include <attr.h>

Annotation for documentation.

Public Functions

inline doc(const char *value)
inline doc(const char *value)

Public Members

const char *value
class testing::internal::DoDefaultAction
#include <gmock-actions.h>

Public Functions

template<typename F>
inline operator Action<F>() const
template<typename F>
inline operator Action<F>() const
class DogAdder

Public Functions

inline explicit DogAdder(const char *a_value)
inline DogAdder(const DogAdder &other)
inline DogAdder operator=(const DogAdder &other)
inline DogAdder operator+(const DogAdder &other) const
inline bool operator<(const DogAdder &other) const
inline const std::string &value() const

Private Members

std::string value_
class dtype : public object, public object
#include <numpy.h>

Public Functions

PYBIND11_OBJECT_DEFAULT (dtype, object, detail::npy_api::get().PyArrayDescr_Check_)
inline explicit dtype(const buffer_info &info)
inline explicit dtype(const std::string &format)
inline dtype(const char *format)
inline dtype(list names, list formats, list offsets, ssize_t itemsize)
inline ssize_t itemsize() const

Size of the data type in bytes.

inline bool has_fields() const

Returns true for structured data types.

inline char kind() const

Single-character type code.

PYBIND11_OBJECT_DEFAULT (dtype, object, detail::npy_api::get().PyArrayDescr_Check_)
inline explicit dtype(const buffer_info &info)
inline explicit dtype(const std::string &format)
inline dtype(const char *format)
inline dtype(list names, list formats, list offsets, ssize_t itemsize)
inline ssize_t itemsize() const

Size of the data type in bytes.

inline bool has_fields() const

Returns true for structured data types.

inline char kind() const

Single-character type code.

Public Static Functions

static inline dtype from_args(object args)

This is essentially the same as calling numpy.dtype(args) in Python.

template<typename T>
static inline dtype of()

Return dtype associated with a C++ type.

static inline dtype from_args(object args)

This is essentially the same as calling numpy.dtype(args) in Python.

template<typename T>
static inline dtype of()

Return dtype associated with a C++ type.

Private Functions

inline dtype strip_padding(ssize_t itemsize)
inline dtype strip_padding(ssize_t itemsize)

Private Static Functions

static inline object _dtype_from_pep3118()
static inline object _dtype_from_pep3118()
template<typename type>
class duration_caster
#include <chrono.h>

Public Types

typedef type::rep rep
typedef type::period period
typedef std::chrono::duration<uint_fast32_t, std::ratio<86400>> days
typedef type::rep rep
typedef type::period period
typedef std::chrono::duration<uint_fast32_t, std::ratio<86400>> days

Public Functions

inline bool load(handle src, bool)
PYBIND11_TYPE_CASTER (type, _("datetime.timedelta"))
inline bool load(handle src, bool)
PYBIND11_TYPE_CASTER (type, _("datetime.timedelta"))

Public Static Functions

static inline const std::chrono::duration<rep, period> &get_duration(const std::chrono::duration<rep, period> &src)
template<typename Clock>
static inline std::chrono::duration<rep, period> get_duration(const std::chrono::time_point<Clock, std::chrono::duration<rep, period>> &src)
static inline handle cast(const type &src, return_value_policy, handle)
static inline const std::chrono::duration<rep, period> &get_duration(const std::chrono::duration<rep, period> &src)
template<typename Clock>
static inline std::chrono::duration<rep, period> get_duration(const std::chrono::time_point<Clock, std::chrono::duration<rep, period>> &src)
static inline handle cast(const type &src, return_value_policy, handle)
struct dynamic_attr
#include <attr.h>

Annotation which enables dynamic attributes, i.e. adds __dict__ to a class.

class DynamicFixture : public testing::Test

Subclassed by DynamicTest< Pass >

Protected Functions

inline DynamicFixture()
inline ~DynamicFixture() override
inline virtual void SetUp() override
inline virtual void TearDown() override

Protected Static Functions

static inline void SetUpTestSuite()
static inline void TearDownTestSuite()
template<bool Pass>
class DynamicTest : public DynamicUnitTestFixture, public DynamicFixture

Public Functions

inline virtual void TestBody() override

Private Functions

inline virtual void TestBody() override
class DynamicUnitTestFixture : public testing::Test

Subclassed by DynamicTest< Pass >

template<typename Type>
struct eigen_extract_stride
#include <eigen.h>

Public Types

using type = Type
using type = Type
template<typename PlainObjectType, int MapOptions, typename StrideType>
struct eigen_extract_stride<Eigen::Map<PlainObjectType, MapOptions, StrideType>>
#include <eigen.h>

Public Types

using type = StrideType
using type = StrideType
template<typename PlainObjectType, int Options, typename StrideType>
struct eigen_extract_stride<Eigen::Ref<PlainObjectType, Options, StrideType>>
#include <eigen.h>

Public Types

using type = StrideType
using type = StrideType
template<typename MapType>
struct eigen_map_caster
#include <eigen.h>

Public Types

using cast_op_type = MapType
using cast_op_type = MapType

Public Functions

bool load(handle, bool) = delete
operator MapType() = delete
bool load(handle, bool) = delete
operator MapType() = delete

Public Static Functions

static inline handle cast(const MapType &src, return_value_policy policy, handle parent)
static inline handle cast(const MapType &src, return_value_policy policy, handle parent)

Public Static Attributes

static constexpr auto name = props::descriptor

Private Types

using props = EigenProps<MapType>
using props = EigenProps<MapType>
template<bool EigenRowMajor>
struct EigenConformable
#include <eigen.h>

Public Functions

inline EigenConformable(bool fits = false)
inline EigenConformable(EigenIndex r, EigenIndex c, EigenIndex rstride, EigenIndex cstride)
inline EigenConformable(EigenIndex r, EigenIndex c, EigenIndex stride)
template<typename props>
inline bool stride_compatible() const
inline operator bool() const
inline EigenConformable(bool fits = false)
inline EigenConformable(EigenIndex r, EigenIndex c, EigenIndex rstride, EigenIndex cstride)
inline EigenConformable(EigenIndex r, EigenIndex c, EigenIndex stride)
template<typename props>
inline bool stride_compatible() const
inline operator bool() const

Public Members

bool conformable = false
EigenIndex rows = 0
EigenIndex cols = 0
EigenDStride stride = {0, 0}
bool negativestrides = false
template<class Scalar, int Rows, int Cols, int Align, int RowsAtCompileTime, int ColsAtCompileTime>
struct YAML::EigenMatrixConverter
#include <yaml_eigen.hpp>

Public Types

typedef Eigen::Matrix<Scalar, Rows, Cols, Align, RowsAtCompileTime, ColsAtCompileTime> MatrixType
typedef Eigen::Matrix<Scalar, Rows, Cols, Align, RowsAtCompileTime, ColsAtCompileTime> MatrixType

Public Static Functions

static inline void resize_if_needed(int rows, int cols, MatrixType &rhs)
static inline Scalar &access_element(int r, int c, MatrixType &rhs)
static inline void resize_if_needed(int rows, int cols, MatrixType &rhs)
static inline Scalar &access_element(int r, int c, MatrixType &rhs)
template<typename Type_>
struct EigenProps
#include <eigen.h>

Public Types

using Type = Type_
using Scalar = typename Type::Scalar
using StrideType = typename eigen_extract_stride<Type>::type
if_zero = std::integral_constant< EigenIndex, i==0 ? ifzero :i >
using Type = Type_
using Scalar = typename Type::Scalar
using StrideType = typename eigen_extract_stride<Type>::type
if_zero = std::integral_constant< EigenIndex, i==0 ? ifzero :i >

Public Static Functions

static inline EigenConformable<row_major> conformable(const array &a)
static inline EigenConformable<row_major> conformable(const array &a)

Public Static Attributes

static constexpr EigenIndex rows = Type::RowsAtCompileTime
static constexpr EigenIndex cols = Type::ColsAtCompileTime
static constexpr EigenIndex size = Type::SizeAtCompileTime
static constexpr bool row_major = Type::IsRowMajor
static constexpr bool vector = Type::IsVectorAtCompileTime
static constexpr bool fixed_rows = rows != Eigen::Dynamic
static constexpr bool fixed_cols = cols != Eigen::Dynamic
static constexpr bool fixed = size != Eigen::Dynamic
static constexpr bool dynamic = !fixed_rows && !fixed_cols
static constexpr EigenIndex inner_stride = if_zero<StrideType::InnerStrideAtCompileTime, 1>::value
static constexpr EigenIndex outer_stride   = if_zero<StrideType::OuterStrideAtCompileTime,                                                        vector ? size : row_major ? cols : rows>::value
static constexpr bool dynamic_stride = inner_stride == Eigen::Dynamic && outer_stride == Eigen::Dynamic
static constexpr bool requires_row_major   = !dynamic_stride && !vector && (row_major ? inner_stride : outer_stride) == 1
static constexpr bool requires_col_major   = !dynamic_stride && !vector && (row_major ? outer_stride : inner_stride) == 1
static constexpr bool show_writeable = is_eigen_dense_map<Type>::value && is_eigen_mutable_map<Type>::value
static constexpr bool show_order = is_eigen_dense_map<Type>::value
static constexpr bool show_c_contiguous = show_order && requires_row_major
static constexpr bool show_f_contiguous = !show_c_contiguous && show_order && requires_col_major
static constexpr auto descriptor = _("numpy.ndarray[") + npy_format_descriptor<Scalar>::name + _("[") + _<fixed_rows>(_<(size_t)rows>(), _("m")) + _(", ") + _<fixed_cols>(_<(size_t)cols>(), _("n")) + _("]") + _<show_writeable>(", flags.writeable", "") + _<show_c_contiguous>(", flags.c_contiguous", "") + _<show_f_contiguous>(", flags.f_contiguous", "") + _("]")
template<class Scalar, int Rows, int Cols, int Align, int RowsAtCompileTime, int ColsAtCompileTime>
struct YAML::EigenVectorConverter
#include <yaml_eigen.hpp>

Public Types

typedef Eigen::Matrix<Scalar, Rows, Cols, Align, RowsAtCompileTime, ColsAtCompileTime> VectorType
typedef Eigen::Matrix<Scalar, Rows, Cols, Align, RowsAtCompileTime, ColsAtCompileTime> VectorType

Public Static Functions

static inline void resize_if_needed(int rows, int cols, VectorType &rhs)
static inline Scalar &access_element(int r, int c, VectorType &rhs)
static inline void resize_if_needed(int rows, int cols, VectorType &rhs)
static inline Scalar &access_element(int r, int c, VectorType &rhs)
struct embedded_module
#include <embed.h>

Python 2.7/3.x compatible version of PyImport_AppendInittab and error checks.

Public Types

using init_t = void (*)()
using init_t = void (*)()

Public Functions

inline embedded_module(const char *name, init_t init)
inline embedded_module(const char *name, init_t init)
class EmptyBasenameParamInst : public testing::TestWithParam<int>
class testing::EmptyTestEventListener : public testing::TestEventListener, public testing::TestEventListener
#include <gtest.h>

Subclassed by SequenceTestingListener, testing::internal::JsonUnitTestResultPrinter, testing::internal::XmlUnitTestResultPrinter, TestListener, ThrowListener

Public Functions

inline virtual void OnTestProgramStart(const UnitTest&) override
inline virtual void OnTestIterationStart(const UnitTest&, int) override
inline virtual void OnEnvironmentsSetUpStart(const UnitTest&) override
inline virtual void OnEnvironmentsSetUpEnd(const UnitTest&) override
inline virtual void OnTestSuiteStart(const TestSuite&) override
inline virtual void OnTestCaseStart(const TestCase&) override
inline virtual void OnTestStart(const TestInfo&) override
inline virtual void OnTestPartResult(const TestPartResult&) override
inline virtual void OnTestEnd(const TestInfo&) override
inline virtual void OnTestSuiteEnd(const TestSuite&) override
inline virtual void OnTestCaseEnd(const TestCase&) override
inline virtual void OnEnvironmentsTearDownStart(const UnitTest&) override
inline virtual void OnEnvironmentsTearDownEnd(const UnitTest&) override
inline virtual void OnTestIterationEnd(const UnitTest&, int) override
inline virtual void OnTestProgramEnd(const UnitTest&) override
inline virtual void OnTestProgramStart(const UnitTest&) override
inline virtual void OnTestIterationStart(const UnitTest&, int) override
inline virtual void OnEnvironmentsSetUpStart(const UnitTest&) override
inline virtual void OnEnvironmentsSetUpEnd(const UnitTest&) override
inline virtual void OnTestSuiteStart(const TestSuite&) override
inline virtual void OnTestCaseStart(const TestCase&) override
inline virtual void OnTestStart(const TestInfo&) override
inline virtual void OnTestPartResult(const TestPartResult&) override
inline virtual void OnTestEnd(const TestInfo&) override
inline virtual void OnTestSuiteEnd(const TestSuite&) override
inline virtual void OnTestCaseEnd(const TestCase&) override
inline virtual void OnEnvironmentsTearDownStart(const UnitTest&) override
inline virtual void OnEnvironmentsTearDownEnd(const UnitTest&) override
inline virtual void OnTestIterationEnd(const UnitTest&, int) override
inline virtual void OnTestProgramEnd(const UnitTest&) override
template<typename Type>
class enum_ : public class_<Type>, public class_<Type>
#include <pybind11.h>

Binds C++ enumerations and enumeration classes to Python.

Public Types

using Base = class_<Type>
using Scalar = typename std::underlying_type<Type>::type
using Base = class_<Type>
using Scalar = typename std::underlying_type<Type>::type

Public Functions

template<typename ...Extra>
inline enum_(const handle &scope, const char *name, const Extra&... extra)
inline enum_ &export_values()

Export enumeration entries into the parent scope.

inline enum_ &value(char const *name, Type value, const char *doc = nullptr)

Add an enumeration entry.

template<typename ...Extra>
inline enum_(const handle &scope, const char *name, const Extra&... extra)
inline enum_ &export_values()

Export enumeration entries into the parent scope.

inline enum_ &value(char const *name, Type value, const char *doc = nullptr)

Add an enumeration entry.

Private Members

detail::enum_base m_base
struct enum_base
#include <pybind11.h>

Public Functions

inline enum_base(handle base, handle parent)
inline PYBIND11_NOINLINE void init (bool is_arithmetic, bool is_convertible)
inline PYBIND11_NOINLINE void value (char const *name_, object value, const char *doc=nullptr)
inline PYBIND11_NOINLINE void export_values ()
inline enum_base(handle base, handle parent)
inline PYBIND11_NOINLINE void init (bool is_arithmetic, bool is_convertible)
inline PYBIND11_NOINLINE void value (char const *name_, object value, const char *doc=nullptr)
inline PYBIND11_NOINLINE void export_values ()

Public Members

handle m_base
handle m_parent
class testing::Environment
#include <gtest.h>

Subclassed by BarEnvironment, FooEnvironment, SetupEnvironment, TestGenerationEnvironment< kExpectedCalls >, testing::internal::EnvironmentInvocationCatcher, testing::internal::FinalSuccessChecker

Public Functions

inline virtual ~Environment()
inline virtual void SetUp()
inline virtual void TearDown()
inline virtual ~Environment()
inline virtual void SetUp()
inline virtual void TearDown()

Private Functions

inline virtual Setup_should_be_spelled_SetUp *Setup()
inline virtual Setup_should_be_spelled_SetUp *Setup()
class testing::internal::EnvironmentInvocationCatcher : public testing::Environment

Protected Functions

inline virtual void SetUp() override
inline virtual void TearDown() override
class testing::internal::EqHelper
#include <gtest.h>

Public Static Functions

template<typename T1, typename T2, typename std::enable_if<!std::is_integral<T1>::value || !std::is_pointer<T2>::value>::type* = nullptr>
static inline AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
static inline AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, BiggestInt lhs, BiggestInt rhs)
template<typename T>
static inline AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, std::nullptr_t, T *rhs)
template<typename T1, typename T2, typename std::enable_if<!std::is_integral<T1>::value || !std::is_pointer<T2>::value>::type* = nullptr>
static inline AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
static inline AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, BiggestInt lhs, BiggestInt rhs)
template<typename T>
static inline AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, std::nullptr_t, T *rhs)
class error_already_set : public runtime_error, public runtime_error
#include <pytypes.h>

Fetch and hold an error which was already set in Python.

An instance of this is typically thrown to propagate python-side errors back through C++ which can either be caught manually or else falls back to the function dispatcher (which then raises the captured error back to python).

Public Functions

inline error_already_set()

Constructs a new exception from the current Python error indicator, if any.

The current Python error indicator will be cleared.

error_already_set(const error_already_set&) = default
error_already_set(error_already_set&&) = default
inline ~error_already_set()
inline void restore()

Give the currently-held error back to Python, if any.

If there is currently a Python error already set it is cleared first. After this call, the current object no longer stores the error variables (but the .what() string is still available).

inline void clear()
inline bool matches(handle exc) const

Check if the currently trapped error type matches the given Python exception class (or a subclass thereof).

May also be passed a tuple to search for any exception class matches in the given tuple.

inline const object &type() const
inline const object &value() const
inline const object &trace() const
inline error_already_set()

Constructs a new exception from the current Python error indicator, if any.

The current Python error indicator will be cleared.

error_already_set(const error_already_set&) = default
error_already_set(error_already_set&&) = default
inline ~error_already_set()
inline void restore()

Give the currently-held error back to Python, if any.

If there is currently a Python error already set it is cleared first. After this call, the current object no longer stores the error variables (but the .what() string is still available).

inline void clear()
inline bool matches(handle exc) const

Check if the currently trapped error type matches the given Python exception class (or a subclass thereof).

May also be passed a tuple to search for any exception class matches in the given tuple.

inline const object &type() const
inline const object &value() const
inline const object &trace() const

Private Members

object m_type
object m_value
object m_trace
struct error_scope
#include <common.h>

RAII wrapper that temporarily clears any Python error state.

Public Functions

inline error_scope()
inline ~error_scope()
inline error_scope()
inline ~error_scope()

Public Members

PyObject *type
PyObject *value
PyObject *trace
class testing::internal::EventRecordingListener : public testing::TestEventListener

Public Functions

inline explicit EventRecordingListener(const char *name)

Protected Functions

inline virtual void OnTestProgramStart(const UnitTest&) override
inline virtual void OnTestIterationStart(const UnitTest&, int iteration) override
inline virtual void OnEnvironmentsSetUpStart(const UnitTest&) override
inline virtual void OnEnvironmentsSetUpEnd(const UnitTest&) override
inline virtual void OnTestCaseStart(const TestCase&) override
inline virtual void OnTestStart(const TestInfo&) override
inline virtual void OnTestPartResult(const TestPartResult&) override
inline virtual void OnTestEnd(const TestInfo&) override
inline virtual void OnTestCaseEnd(const TestCase&) override
inline virtual void OnEnvironmentsTearDownStart(const UnitTest&) override
inline virtual void OnEnvironmentsTearDownEnd(const UnitTest&) override
inline virtual void OnTestIterationEnd(const UnitTest&, int iteration) override
inline virtual void OnTestProgramEnd(const UnitTest&) override

Private Functions

inline std::string GetFullMethodName(const char *name)

Private Members

std::string name_
class testing::internal::EventRecordingListener2 : public testing::TestEventListener

Public Functions

inline explicit EventRecordingListener2(const char *name)

Protected Functions

inline virtual void OnTestProgramStart(const UnitTest&) override
inline virtual void OnTestIterationStart(const UnitTest&, int iteration) override
inline virtual void OnEnvironmentsSetUpStart(const UnitTest&) override
inline virtual void OnEnvironmentsSetUpEnd(const UnitTest&) override
inline virtual void OnTestSuiteStart(const TestSuite&) override
inline virtual void OnTestStart(const TestInfo&) override
inline virtual void OnTestPartResult(const TestPartResult&) override
inline virtual void OnTestEnd(const TestInfo&) override
inline virtual void OnTestSuiteEnd(const TestSuite&) override
inline virtual void OnEnvironmentsTearDownStart(const UnitTest&) override
inline virtual void OnEnvironmentsTearDownEnd(const UnitTest&) override
inline virtual void OnTestIterationEnd(const UnitTest&, int iteration) override
inline virtual void OnTestProgramEnd(const UnitTest&) override

Private Functions

inline std::string GetFullMethodName(const char *name)

Private Members

std::string name_
template<template<typename> class Predicate, typename Default, typename ...Ts>
struct exactly_one
#include <common.h>

Return the one and only type which matches the predicate, or Default if none match.

If more than one type matches the predicate, fail at compile-time.

Public Types

using type = conditional_t<found, typename pack_element<index, Ts...>::type, Default>
using type = conditional_t<found, typename pack_element<index, Ts...>::type, Default>

Public Static Attributes

static constexpr auto found = constexpr_sum(Predicate<Ts>::value...)
static constexpr auto index   = found ? constexpr_first<Predicate, Ts...>() : 0
template<template<typename> class P, typename Default>
struct exactly_one<P, Default>
#include <common.h>

Public Types

using type = Default
using type = Default
template<typename type>
class exception : public object, public object
#include <pybind11.h>

Wrapper to generate a new Python exception type.

This should only be used with PyErr_SetString for now. It is not (yet) possible to use as a py::base. Template type argument is reserved for future use.

Public Functions

exception() = default
inline exception(handle scope, const char *name, PyObject *base = PyExc_Exception)
inline void operator()(const char *message)
exception() = default
inline exception(handle scope, const char *name, PyObject *base = PyExc_Exception)
inline void operator()(const char *message)
struct ExcessiveArg
#include <gmock-actions.h>
class testing::internal::ExpectationTester

Public Functions

inline void SetCallCount(int n, ExpectationBase *exp)
template<typename T>
class ExpectCallTest : public testing::Test
class ExpectFailureTest : public testing::Test

Public Types

enum FailureMode

Values:

enumerator FATAL_FAILURE
enumerator NONFATAL_FAILURE

Public Static Functions

static inline void AddFailure(FailureMode failure)
class ExternalGeneratorTest : public testing::TestWithParam<int>
class ExternalInstantiationTest : public testing::TestWithParam<int>
#include <googletest-param-test-test.h>
template<typename CFunc, typename AFunc = void_type (*)(), typename = function_signature_t<CFunc>, typename = function_signature_t<AFunc>>
struct factory
#include <init.h>
template<typename CFunc, typename AFunc, typename CReturn, typename ...CArgs, typename AReturn, typename ...AArgs>
struct factory<CFunc, AFunc, CReturn(CArgs...), AReturn(AArgs...)>
#include <init.h>

Public Functions

inline factory(CFunc &&c, AFunc &&a)
template<typename Class, typename ...Extra>
inline void execute(Class &cl, const Extra&... extra) &&
inline factory(CFunc &&c, AFunc &&a)
template<typename Class, typename ...Extra>
inline void execute(Class &cl, const Extra&... extra) &&

Public Members

remove_reference_t<CFunc> class_factory
remove_reference_t<AFunc> alias_factory
template<typename Func, typename Return, typename ...Args>
struct factory<Func, void_type (*)(), Return(Args...)>
#include <init.h>

Public Functions

inline factory(Func &&f)
template<typename Class, typename ...Extra>
inline void execute(Class &cl, const Extra&... extra) &&
inline factory(Func &&f)
template<typename Class, typename ...Extra>
inline void execute(Class &cl, const Extra&... extra) &&

Public Members

remove_reference_t<Func> class_factory
class testing::DefaultValue::FactoryValueProducer : public testing::DefaultValue<T>::ValueProducer, public testing::DefaultValue<T>::ValueProducer

Public Functions

inline explicit FactoryValueProducer(FactoryFunction factory)
inline virtual T Produce() override
inline explicit FactoryValueProducer(FactoryFunction factory)
inline virtual T Produce() override

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(FactoryValueProducer)
GTEST_DISALLOW_COPY_AND_ASSIGN_(FactoryValueProducer)

Private Members

const FactoryFunction factory_
class FailedTest : public Test
class FailingParamTest : public testing::TestWithParam<int>
struct faketype
#include <gtest.h>
struct testing::internal::FallbackPrinter
#include <gtest-printers.h>

Public Static Functions

template<typename T>
static inline void PrintValue(const T&, ::std::ostream *os)
template<typename T>
static inline void PrintValue(const T&, ::std::ostream *os)
class FatalFailureInFixtureConstructorTest : public testing::Test

Protected Functions

inline FatalFailureInFixtureConstructorTest()
inline ~FatalFailureInFixtureConstructorTest() override
inline virtual void SetUp() override
inline virtual void TearDown() override

Private Functions

inline void Init()
class FatalFailureInSetUpTest : public testing::Test

Protected Functions

inline ~FatalFailureInSetUpTest() override
inline virtual void SetUp() override
inline virtual void TearDown() override

Private Functions

inline void Deinit()
struct field_descriptor
#include <numpy.h>

Public Members

const char *name
ssize_t offset
ssize_t size
std::string format
dtype descr
class FieldHelper
#include <gmock_link_test.h>

Public Functions

inline explicit FieldHelper(int a_field)
inline int field() const

Public Members

int field_
class package_template::File_configuration : public package_template::Gains_configuration
#include <file_configuration.hpp>

Reading configuration from yaml file.

Public Functions

File_configuration(std::string yaml_file)

Returns error encountered when reading configuration.

See

has_error()

Parameters

yaml_file – absolute path to configuration yaml file. The file is expected to have parameters “kp”, “kd” and “ki”

virtual double get_kp() const

Get the proportional gain.

Returns

double

virtual double get_kd() const

Get the derivative gain.

Returns

double

virtual double get_ki() const

Get the integral gain.

Returns

double

virtual bool has_error() const

Enquire if an error was encountered while reading the configuration.

See

get_error()

Returns

true if an error has been encountered

Returns

false otherwise

virtual std::string get_error() const

returns error encountered when reading configuration

See

has_error()

Private Members

double kp_

Proportinal gain.

double kd_

Derivative gain.

double ki_

Integral gain.

std::string error_message_

Internal error message.

bool error_

True if an error occured.

class testing::internal::FinalSuccessChecker : public testing::Environment

Protected Functions

inline virtual void TearDown() override
template<typename T, typename E, typename Printer, typename ...Printers>
struct FindFirstPrinter
#include <gtest-printers.h>
template<typename T, typename Printer, typename ...Printers>
struct testing::internal::FindFirstPrinter<T, decltype(Printer::PrintValue(std::declval<const T&>(), nullptr)), Printer, Printers...>
#include <gtest-printers.h>

Public Types

using type = Printer
using type = Printer
class testing::DefaultValue::FixedValueProducer : public testing::DefaultValue<T>::ValueProducer, public testing::DefaultValue<T>::ValueProducer

Public Functions

inline explicit FixedValueProducer(T value)
inline virtual T Produce() override
inline explicit FixedValueProducer(T value)
inline virtual T Produce() override

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(FixedValueProducer)
GTEST_DISALLOW_COPY_AND_ASSIGN_(FixedValueProducer)

Private Members

const T value_
class Fixture : public Test

Protected Functions

inline void SetUp() override
struct testing::Flags

Public Functions

inline Flags()

Public Members

bool also_run_disabled_tests
bool break_on_failure
bool catch_exceptions
bool death_test_use_fork
bool fail_fast
const char *filter
bool list_tests
const char *output
bool brief
bool print_time
int32_t random_seed
int32_t repeat
bool shuffle
int32_t stack_trace_depth
const char *stream_result_to
bool throw_on_failure

Public Static Functions

static inline Flags AlsoRunDisabledTests(bool also_run_disabled_tests)
static inline Flags BreakOnFailure(bool break_on_failure)
static inline Flags CatchExceptions(bool catch_exceptions)
static inline Flags DeathTestUseFork(bool death_test_use_fork)
static inline Flags FailFast(bool fail_fast)
static inline Flags Filter(const char *filter)
static inline Flags ListTests(bool list_tests)
static inline Flags Output(const char *output)
static inline Flags Brief(bool brief)
static inline Flags PrintTime(bool print_time)
static inline Flags RandomSeed(int32_t random_seed)
static inline Flags Repeat(int32_t repeat)
static inline Flags Shuffle(bool shuffle)
static inline Flags StackTraceDepth(int32_t stack_trace_depth)
static inline Flags StreamResultTo(const char *stream_result_to)
static inline Flags ThrowOnFailure(bool throw_on_failure)
class float_ : public object, public object
#include <pytypes.h>

Public Functions

inline float_(float value)
inline float_(double value = .0)
inline operator float() const
inline operator double() const
inline float_(float value)
inline float_(double value = .0)
inline operator float() const
inline operator double() const
class testing::gmock_more_actions_test::Foo

Public Functions

inline Foo()
inline int Nullary() const
inline short Unary(long x)
inline std::string Binary(const std::string &str, char c) const
inline int Ternary(int x, bool y, char z)
inline int SumOf4(int a, int b, int c, int d) const
inline int SumOfLast2(Unused, Unused, int a, int b) const
inline int SumOf5(int a, int b, int c, int d, int e)
inline int SumOf6(int a, int b, int c, int d, int e, int f)
inline std::string Concat7(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7)
inline std::string Concat8(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8)
inline std::string Concat9(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8, const char *s9)
inline std::string Concat10(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8, const char *s9, const char *s10)

Private Members

int value_
class testing::gmock_nice_strict_test::Foo

Subclassed by testing::gmock_nice_strict_test::MockFoo

Public Functions

inline virtual ~Foo()
virtual void DoThis() = 0
virtual int DoThat(bool flag) = 0
struct testing::gtest_printers_test::Foo

Public Functions

inline virtual ~Foo()
inline int MyMethod(char x)
inline virtual char MyVirtualMethod(int)

Public Members

int value
class FooEnvironment : public testing::Environment

Public Functions

inline virtual void SetUp() override
inline virtual void TearDown() override
class testing::gmock_function_mocker_test::FooInterface

Subclassed by testing::gmock_function_mocker_test::LegacyMockFoo, testing::gmock_function_mocker_test::MockFoo

Public Types

using fn_ptr = int (*)(bool)

Public Functions

inline virtual ~FooInterface()
virtual void VoidReturning(int x) = 0
virtual int Nullary() = 0
virtual bool Unary(int x) = 0
virtual long Binary(short x, int y) = 0
virtual int Decimal(bool b, char c, short d, int e, long f, float g, double h, unsigned i, char *j, const std::string &k) = 0
virtual bool TakesNonConstReference(int &n) = 0
virtual std::string TakesConstReference(const int &n) = 0
virtual bool TakesConst(const int x) = 0
virtual int OverloadedOnArgumentNumber() = 0
virtual int OverloadedOnArgumentNumber(int n) = 0
virtual int OverloadedOnArgumentType(int n) = 0
virtual char OverloadedOnArgumentType(char c) = 0
virtual int OverloadedOnConstness() = 0
virtual char OverloadedOnConstness() const = 0
virtual int TypeWithHole(int (*func)()) = 0
virtual int TypeWithComma(const std::map<int, std::string> &a_map) = 0
virtual int TypeWithTemplatedCopyCtor(const TemplatedCopyable<int>&) = 0
virtual fn_ptr ReturnsFunctionPointer2(int) = 0
virtual int RefQualifiedConstRef() const & = 0
virtual int RefQualifiedConstRefRef() const && = 0
virtual int RefQualifiedRef() & = 0
virtual int RefQualifiedRefRef() && = 0
virtual int RefQualifiedOverloaded() const & = 0
virtual int RefQualifiedOverloaded() const && = 0
virtual int RefQualifiedOverloaded() & = 0
virtual int RefQualifiedOverloaded() && = 0

Public Members

int(*)(bool) ReturnsFunctionPointer1 (int)
class FooTest : public testing::Test, public testing::Test
class FooTestFixture : public testing::Test
template<typename T, typename SFINAE = void>
struct format_descriptor
#include <common.h>
template<size_t N>
struct format_descriptor<char[N]>
#include <numpy.h>

Public Static Functions

static inline std::string format()
static inline std::string format()
template<size_t N>
struct format_descriptor<std::array<char, N>>
#include <numpy.h>

Public Static Functions

static inline std::string format()
static inline std::string format()
template<typename T>
struct format_descriptor<std::complex<T>, detail::enable_if_t<std::is_floating_point<T>::value>>
#include <complex.h>

glibc defines I as a macro which breaks things, e.g., boost template names

Public Static Functions

static inline std::string format()
static inline std::string format()

Public Static Attributes

static constexpr const char c = format_descriptor<T>::c
static constexpr const char value[3] = {'Z', c, '\0'}
template<typename T>
struct format_descriptor<T, detail::enable_if_t<detail::array_info<T>::is_array>>
#include <numpy.h>

Public Static Functions

static inline std::string format()
static inline std::string format()
template<typename T>
struct format_descriptor<T, detail::enable_if_t<detail::is_pod_struct<T>::value>>
#include <numpy.h>

Public Static Functions

static inline std::string format()
static inline std::string format()
template<typename T>
struct format_descriptor<T, detail::enable_if_t<std::is_arithmetic<T>::value>>
#include <common.h>

Public Static Functions

static inline std::string format()
static inline std::string format()

Public Static Attributes

static constexpr const char c = "?bBhHiIqQfdg"[detail::is_fmt_numeric<T>::index]
static constexpr const char value[2] = {c, '\0'}
template<typename T>
struct format_descriptor<T, detail::enable_if_t<std::is_enum<T>::value>>
#include <numpy.h>

Public Static Functions

static inline std::string format()
static inline std::string format()
template<typename ToPrint, typename OtherOperand>
class testing::internal::FormatForComparison
#include <gtest-printers.h>

Public Static Functions

static inline ::std::string Format(const ToPrint &value)
static inline ::std::string Format(const ToPrint &value)
template<typename ToPrint, size_t N, typename OtherOperand>
class testing::internal::FormatForComparison<ToPrint[N], OtherOperand>
#include <gtest-printers.h>

Public Static Functions

static inline ::std::string Format(const ToPrint *value)
static inline ::std::string Format(const ToPrint *value)
class function : public object, public object
#include <pytypes.h>

Subclassed by cpp_function, cpp_function

Public Functions

inline handle cpp_function() const
inline bool is_cpp_function() const
inline handle cpp_function() const
inline bool is_cpp_function() const
struct function_call
#include <cast.h>

Internal data associated with a single function call.

Public Functions

inline function_call(const function_record &f, handle p)
function_call(const function_record &f, handle p)

Public Members

const function_record &func

The function data:

std::vector<handle> args

Arguments passed to the function:

std::vector<bool> args_convert

The convert value the arguments should be loaded with.

object args_ref

Extra references for the optional py::args and/or py::kwargs arguments (which, if present, are also in args but without a reference).

object kwargs_ref
handle parent

The parent, if any.

handle init_self

If this is a call to an initializer, this argument contains self

struct function_record
#include <attr.h>

Internal data structure which holds metadata about a bound function (signature, overloads, etc.)

Public Functions

inline function_record()
inline function_record()

Public Members

char *name = nullptr

Function name.

char *doc = nullptr
char *signature = nullptr

Human-readable version of the function signature.

std::vector<argument_record> args

List of registered keyword arguments.

handle(* impl )(function_call &)  = nullptr

Pointer to lambda function which converts arguments and performs the actual call.

void *data[3] = {}

Storage for the wrapped function pointer and captured data, if any.

void(* free_data )(function_record *ptr)  = nullptr

Pointer to custom destructor for ‘data’ (if needed)

return_value_policy policy = return_value_policy::automatic

Return value policy associated with this function.

bool is_constructor

True if name == ‘init’.

bool is_new_style_constructor

True if this is a new-style __init__ defined in detail/init.h

bool is_stateless

True if this is a stateless function pointer.

bool is_operator

True if this is an operator (add), etc.

bool has_args

True if the function has a ‘*args’ argument.

bool has_kwargs

True if the function has a ‘**kwargs’ argument.

bool is_method

True if this is a method.

std::uint16_t nargs

Number of arguments (including py::args and/or py::kwargs, if present)

PyMethodDef *def = nullptr

Python method object.

handle scope

Python handle to the parent scope (a class or a module)

handle sibling

Python handle to the sibling function representing an overload chain.

function_record *next = nullptr

Pointer to next overload.

template<class T>
class testing::gmock_function_mocker_test::FunctionMockerTest : public testing::Test

Protected Functions

inline FunctionMockerTest()

Protected Attributes

FooInterface *const foo_
T mock_foo_
struct testing::internal::FunctionPointerPrinter
#include <gtest-printers.h>

Public Static Functions

template<typename T, typename = typename std::enable_if<std::is_function<T>::value>::type>
static inline void PrintValue(T *p, ::std::ostream *os)
template<typename T, typename = typename std::enable_if<std::is_function<T>::value>::type>
static inline void PrintValue(T *p, ::std::ostream *os)
class package_template::Gains_configuration
#include <gains_configuration.hpp>

Abstract class defining for the PID configuration.

This virtual object describes the configuration a PID objects is waiting for. Daughter class will for example be initialize through files, ROS params, etc.

Subclassed by package_template::DefaultConfiguration, package_template::File_configuration, package_template::RosParameters_configuration

Public Functions

inline virtual ~Gains_configuration()

The default destructor do nothing.

virtual double get_kp() const = 0

Get the proportional gain.

Returns

double

virtual double get_kd() const = 0

Get the derivative gain.

Returns

double

virtual double get_ki() const = 0

Get the integral gain.

Returns

double

virtual bool has_error() const = 0

Enquire if an error was encountered while reading the configuration.

See

get_error()

Returns

true if an error has been encountered

Returns

false otherwise

virtual std::string get_error() const = 0

returns error encountered when reading configuration

See

has_error()

class GeneratorEvaluationTest : public testing::TestWithParam<int>

Public Static Functions

static inline int param_value()
static inline void set_param_value(int param_value)

Private Static Attributes

static int param_value_ = 0
struct generic_item
#include <pytypes.h>

Public Types

using key_type = object
using key_type = object

Public Static Functions

static inline object get(handle obj, handle key)
static inline void set(handle obj, handle key, handle val)
static inline object get(handle obj, handle key)
static inline void set(handle obj, handle key, handle val)
template<typename Policy>
class generic_iterator : public Policy, public Policy
#include <pytypes.h>

STL iterator template used for tuple, list, sequence and dict.

Public Types

using difference_type = ssize_t
using iterator_category = typename Policy::iterator_category
using value_type = typename Policy::value_type
using reference = typename Policy::reference
using pointer = typename Policy::pointer
using difference_type = ssize_t
using iterator_category = typename Policy::iterator_category
using value_type = typename Policy::value_type
using reference = typename Policy::reference
using pointer = typename Policy::pointer

Public Functions

generic_iterator() = default
inline generic_iterator(handle seq, ssize_t index)
inline reference operator*() const
inline reference operator[](difference_type n) const
inline pointer operator->() const
inline It &operator++()
inline It operator++(int)
inline It &operator--()
inline It operator--(int)
inline It &operator+=(difference_type n)
inline It &operator-=(difference_type n)
generic_iterator() = default
inline generic_iterator(handle seq, ssize_t index)
inline reference operator*() const
inline reference operator[](difference_type n) const
inline pointer operator->() const
inline It &operator++()
inline It operator++(int)
inline It &operator--()
inline It operator--(int)
inline It &operator+=(difference_type n)
inline It &operator-=(difference_type n)

Private Types

using It = generic_iterator
using It = generic_iterator

Friends

inline friend friend It operator+ (const It &a, difference_type n)
inline friend friend It operator+ (difference_type n, const It &b)
inline friend friend It operator- (const It &a, difference_type n)
inline friend friend difference_type operator- (const It &a, const It &b)
inline friend friend bool operator== (const It &a, const It &b)
inline friend friend bool operator!= (const It &a, const It &b)
inline friend friend bool operator< (const It &a, const It &b)
inline friend friend bool operator> (const It &a, const It &b)
inline friend friend bool operator>= (const It &a, const It &b)
inline friend friend bool operator<= (const It &a, const It &b)
inline friend friend It operator+ (const It &a, difference_type n)
inline friend friend It operator+ (difference_type n, const It &b)
inline friend friend It operator- (const It &a, difference_type n)
inline friend friend difference_type operator- (const It &a, const It &b)
inline friend friend bool operator== (const It &a, const It &b)
inline friend friend bool operator!= (const It &a, const It &b)
inline friend friend bool operator< (const It &a, const It &b)
inline friend friend bool operator> (const It &a, const It &b)
inline friend friend bool operator>= (const It &a, const It &b)
inline friend friend bool operator<= (const It &a, const It &b)
class generic_type : public object, public object
#include <pybind11.h>

Generic support for creating new Python heap types.

Protected Functions

inline void initialize(const type_record &rec)
inline void mark_parents_nonsimple(PyTypeObject *value)

Helper function which tags all parents of a type using mult. inheritance.

inline void install_buffer_funcs(buffer_info *(*get_buffer)(PyObject*, void*), void *get_buffer_data, )
inline void def_property_static_impl(const char *name, handle fget, handle fset, detail::function_record *rec_func)
inline void initialize(const type_record &rec)
inline void mark_parents_nonsimple(PyTypeObject *value)

Helper function which tags all parents of a type using mult. inheritance.

inline void install_buffer_funcs(buffer_info *(*get_buffer)(PyObject*, void*), void *get_buffer_data, )
inline void def_property_static_impl(const char *name, handle fget, handle fset, detail::function_record *rec_func)

Friends

friend class class_
friend class class_
template<typename T1, typename T2, typename T3, int k4, bool k5, unsigned int k6, typename T7, typename T8, typename T9>
struct testing::gmock_more_actions_test::GiantTemplate

Public Functions

inline explicit GiantTemplate(int a_value)

Public Members

int value
class gil_scoped_acquire
#include <pybind11.h>
class gil_scoped_release
#include <pybind11.h>
class GMockOutputTest : public testing::Test

Protected Attributes

NaggyMock<MockFoo> foo_
class testing::internal::GoogleTestFailureReporter : public FailureReporterInterface

Public Functions

inline void ReportFailure(FailureType type, const char *file, int line, const std::string &message) override
class handle : public detail::object_api<handle>, public detail::object_api<handle>
#include <pytypes.h>

Holds a reference to a Python object (no reference counting)

The handle class is a thin wrapper around an arbitrary Python object (i.e. a PyObject * in Python’s C API). It does not perform any automatic reference counting and merely provides a basic C++ interface to various Python API functions.

.. seealso:: The object class inherits from handle and adds automatic reference counting features.

Subclassed by args_proxy, args_proxy, kwargs_proxy, kwargs_proxy, object, object

Public Functions

handle() = default

The default constructor creates a handle with a nullptr-valued pointer.

inline handle(PyObject *ptr)

Creates a handle from the given raw Python object pointer.

inline PyObject *ptr() const

Return the underlying PyObject * pointer.

inline PyObject *&ptr()
inline const handle &inc_ref() const &

Manually increase the reference count of the Python object.

Usually, it is preferable to use the object class which derives from handle and calls this function automatically. Returns a reference to itself.

inline const handle &dec_ref() const &

Manually decrease the reference count of the Python object.

Usually, it is preferable to use the object class which derives from handle and calls this function automatically. Returns a reference to itself.

template<typename T>
T cast() const

Attempt to cast the Python object into the given C++ type.

A cast_error will be throw upon failure.

inline explicit operator bool() const

Return true when the handle wraps a valid Python object.

inline bool operator==(const handle &h) const

Deprecated: Check that the underlying pointers are the same.

Equivalent to obj1 is obj2 in Python.

inline bool operator!=(const handle &h) const
inline bool check() const
handle() = default

The default constructor creates a handle with a nullptr-valued pointer.

inline handle(PyObject *ptr)

Creates a handle from the given raw Python object pointer.

inline PyObject *ptr() const

Return the underlying PyObject * pointer.

inline PyObject *&ptr()
inline const handle &inc_ref() const &

Manually increase the reference count of the Python object.

Usually, it is preferable to use the object class which derives from handle and calls this function automatically. Returns a reference to itself.

inline const handle &dec_ref() const &

Manually decrease the reference count of the Python object.

Usually, it is preferable to use the object class which derives from handle and calls this function automatically. Returns a reference to itself.

template<typename T>
T cast() const

Attempt to cast the Python object into the given C++ type.

A cast_error will be throw upon failure.

inline explicit operator bool() const

Return true when the handle wraps a valid Python object.

inline bool operator==(const handle &h) const

Deprecated: Check that the underlying pointers are the same.

Equivalent to obj1 is obj2 in Python.

inline bool operator!=(const handle &h) const
inline bool check() const
template<>
inline void cast() const

Protected Attributes

PyObject *m_ptr = nullptr
template<typename T>
struct handle_type_name
#include <cast.h>

Public Static Attributes

static constexpr auto name = _<T>()
template<>
struct handle_type_name<args>
#include <cast.h>

Public Static Attributes

static constexpr auto name = _("*args")
template<typename T, int Flags>
struct handle_type_name<array_t<T, Flags>>
#include <numpy.h>

Public Static Attributes

static constexpr auto name = _("numpy.ndarray[") + npy_format_descriptor<T>::name + _("]")
template<>
struct handle_type_name<bytes>
#include <cast.h>

Public Static Attributes

static constexpr auto name = _(PYBIND11_BYTES_NAME)
template<>
struct handle_type_name<kwargs>
#include <cast.h>

Public Static Attributes

static constexpr auto name = _("**kwargs")
template<typename T, typename SFINAE = void>
struct has_operator_delete : public false_type, public false_type
#include <pybind11.h>
template<typename T>
struct has_operator_delete<T, void_t<decltype(static_cast<void (*)(void*)>(T::operator delete))>> : public true_type, public true_type
#include <pybind11.h>
template<typename T, typename SFINAE = void>
struct has_operator_delete_size : public false_type, public false_type
#include <pybind11.h>
template<typename T>
struct has_operator_delete_size<T, void_t<decltype(static_cast<void (*)(void*, size_t)>(T::operator delete))>> : public true_type, public true_type
#include <pybind11.h>
struct HasDebugStringMethods

Subclassed by InheritsDebugStringMethods

Public Functions

inline std::string DebugString() const
inline std::string ShortDebugString() const
struct testing::internal::ImplBase::Holder
#include <gmock-actions.h>

Public Functions

inline explicit operator const Impl&() const
inline explicit operator const Impl&() const

Public Members

std::shared_ptr<Impl> ptr
template<typename T>
struct holder_helper
#include <cast.h>

Helper class which abstracts away certain actions.

Users can provide specializations for custom holders, but it’s only necessary if the type has a non-standard interface.

Public Static Functions

static inline auto get(const T &p) -> decltype(p.get())
static inline auto get(const T &p) -> decltype(p.get())
template<typename FunctionImpl>
struct testing::Action::IgnoreArgs

Public Functions

template<typename ...Args>
inline Result operator()(const Args&...) const
template<typename ...Args>
inline Result operator()(const Args&...) const

Public Members

FunctionImpl function_impl
template<typename A>
class testing::internal::IgnoreResultAction
#include <gmock-actions.h>

Public Functions

inline explicit IgnoreResultAction(const A &action)
template<typename F>
inline operator Action<F>() const
inline explicit IgnoreResultAction(const A &action)
template<typename F>
inline operator Action<F>() const

Private Members

const A action_
template<typename F>
class testing::internal::IgnoreResultAction::Impl : public testing::ActionInterface<F>, public testing::ActionInterface<F>

Public Types

typedef internal::Function<F>::Result Result
typedef internal::Function<F>::ArgumentTuple ArgumentTuple
typedef internal::Function<F>::Result Result
typedef internal::Function<F>::ArgumentTuple ArgumentTuple

Public Functions

inline explicit Impl(const A &action)
inline virtual void Perform(const ArgumentTuple &args) override
inline explicit Impl(const A &action)
inline virtual void Perform(const ArgumentTuple &args) override

Private Types

typedef internal::Function<F>::MakeResultIgnoredValue OriginalFunction
typedef internal::Function<F>::MakeResultIgnoredValue OriginalFunction

Private Members

const Action<OriginalFunction> action_
template<typename R_, typename F>
class testing::internal::ReturnAction::Impl : public testing::ActionInterface<F>, public testing::ActionInterface<F>

Public Types

typedef Function<F>::Result Result
typedef Function<F>::ArgumentTuple ArgumentTuple
typedef Function<F>::Result Result
typedef Function<F>::ArgumentTuple ArgumentTuple

Public Functions

inline explicit Impl(const std::shared_ptr<R> &value)
inline virtual Result Perform(const ArgumentTuple&) override
inline explicit Impl(const std::shared_ptr<R> &value)
inline virtual Result Perform(const ArgumentTuple&) override

Private Functions

GTEST_COMPILE_ASSERT_ (!std::is_reference< Result >::value, Result_cannot_be_a_reference_type)
GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl)
GTEST_COMPILE_ASSERT_ (!std::is_reference< Result >::value, Result_cannot_be_a_reference_type)
GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl)

Private Members

R value_before_cast_
Result value_
template<typename F>
class testing::internal::ReturnRefAction::Impl : public testing::ActionInterface<F>, public testing::ActionInterface<F>

Public Types

typedef Function<F>::Result Result
typedef Function<F>::ArgumentTuple ArgumentTuple
typedef Function<F>::Result Result
typedef Function<F>::ArgumentTuple ArgumentTuple

Public Functions

inline explicit Impl(T &ref)
inline virtual Result Perform(const ArgumentTuple&) override
inline explicit Impl(T &ref)
inline virtual Result Perform(const ArgumentTuple&) override

Private Members

T &ref_
template<typename F>
class testing::internal::ReturnRefOfCopyAction::Impl : public testing::ActionInterface<F>, public testing::ActionInterface<F>

Public Types

typedef Function<F>::Result Result
typedef Function<F>::ArgumentTuple ArgumentTuple
typedef Function<F>::Result Result
typedef Function<F>::ArgumentTuple ArgumentTuple

Public Functions

inline explicit Impl(const T &value)
inline virtual Result Perform(const ArgumentTuple&) override
inline explicit Impl(const T &value)
inline virtual Result Perform(const ArgumentTuple&) override

Private Members

T value_
template<typename R_, typename F>
class testing::internal::ReturnAction::Impl<ByMoveWrapper<R_>, F> : public testing::ActionInterface<F>, public testing::ActionInterface<F>

Public Types

typedef Function<F>::Result Result
typedef Function<F>::ArgumentTuple ArgumentTuple
typedef Function<F>::Result Result
typedef Function<F>::ArgumentTuple ArgumentTuple

Public Functions

inline explicit Impl(const std::shared_ptr<R> &wrapper)
inline virtual Result Perform(const ArgumentTuple&) override
inline explicit Impl(const std::shared_ptr<R> &wrapper)
inline virtual Result Perform(const ArgumentTuple&) override

Private Members

bool performed_
const std::shared_ptr<R> wrapper_
template<typename Impl>
struct testing::internal::ImplBase
#include <gmock-actions.h>

Public Types

using type = typename std::conditional<std::is_constructible<Impl>::value, Impl, Holder>::type
using type = typename std::conditional<std::is_constructible<Impl>::value, Impl, Holder>::type
template<size_t...>
struct index_sequence
#include <common.h>

Index sequences.

struct InheritsDebugStringMethods : public HasDebugStringMethods
struct instance
#include <common.h>

The ‘instance’ type which needs to be standard layout (need to be able to use ‘offsetof’)

Public Functions

inline void allocate_layout()

Initializes all of the above type/values/holders data (but not the instance values themselves)

inline void deallocate_layout()

Destroys/deallocates all of the above.

inline value_and_holder get_value_and_holder(const type_info *find_type = nullptr, bool throw_if_missing = true)

Returns the value_and_holder wrapper for the given type (or the first, if find_type omitted).

Extracts C++ value and holder pointer references from an instance (which may contain multiple values/holders for python-side multiple inheritance) that match the given type.

Returns a default-constructed (with .inst = nullptr) object on failure if throw_if_missing is false.

Throws an error if the given type (or ValueType, if omitted) is not a pybind11 base of the given instance. If find_type is omitted (or explicitly specified as nullptr) the first value/holder are returned, regardless of type (and the resulting .type will be nullptr).

The returned object should be short-lived: in particular, it must not outlive the called-upon instance.

void allocate_layout()

Initializes all of the above type/values/holders data (but not the instance values themselves)

void deallocate_layout()

Destroys/deallocates all of the above.

value_and_holder get_value_and_holder(const type_info *find_type = nullptr, bool throw_if_missing = true)

Returns the value_and_holder wrapper for the given type (or the first, if find_type omitted).

Returns a default-constructed (with .inst = nullptr) object on failure if throw_if_missing is false.

Public Members

void *simple_value_holder[1 + instance_simple_holder_in_ptrs()]
nonsimple_values_and_holders nonsimple
PyObject_HEAD union instance::@0 @1

Storage for pointers and holder; see simple_layout, below, for a description.

PyObject *weakrefs

Weak references.

bool owned

If true, the pointer is owned which means we’re free to manage it with a holder.

bool simple_layout

An instance has two possible value/holder layouts.

Simple layout (when this flag is true), means the simple_value_holder is set with a pointer and the holder object governing that pointer, i.e. [val1*][holder]. This layout is applied whenever there is no python-side multiple inheritance of bound C++ types and the type’s holder will fit in the default space (which is large enough to hold either a std::unique_ptr or std::shared_ptr).

Non-simple layout applies when using custom holders that require more space than shared_ptr (which is typically the size of two pointers), or when multiple inheritance is used on the python side. Non-simple layout allocates the required amount of memory to have multiple bound C++ classes as parents. Under this layout, nonsimple.values_and_holders is set to a pointer to allocated space of the required space to hold a sequence of value pointers and holders followed status, a set of bit flags (1 byte each), i.e. [val1*][holder1][val2*][holder2]…[bb…] where each [block] is rounded up to a multiple of sizeof(void *). nonsimple.status is, for convenience, a pointer to the beginning of the [bb…] block (but not independently allocated).

Status bits indicate whether the associated holder is constructed (& status_holder_constructed) and whether the value pointer is registered (& status_instance_registered) in registered_instances.

bool simple_holder_constructed

For simple layout, tracks whether the holder has been constructed.

bool simple_instance_registered

For simple layout, tracks whether the instance is registered in registered_instances

bool has_patients

If true, get_internals().patients has an entry for this object.

PyObject_HEAD union instance::@5 @6

Storage for pointers and holder; see simple_layout, below, for a description.

Public Static Attributes

static constexpr uint8_t status_holder_constructed = 1

Bit values for the non-simple status flags.

static constexpr uint8_t status_instance_registered = 2
class InstantiationInMultipleTranslationUnitsTest : public testing::TestWithParam<int>
#include <googletest-param-test-test.h>
class int_ : public object, public object
#include <pytypes.h>

Public Functions

inline int_()
template<typename T, detail::enable_if_t<std::is_integral<T>::value, int> = 0>
inline int_(T value)
template<typename T, detail::enable_if_t<std::is_integral<T>::value, int> = 0>
inline operator T() const
inline int_()
template<typename T, detail::enable_if_t<std::is_integral<T>::value, int> = 0>
inline int_(T value)
template<typename T, detail::enable_if_t<std::is_integral<T>::value, int> = 0>
inline operator T() const
template<size_t Rem, size_t... Digits>
struct int_to_str
#include <descr.h>
template<size_t... Digits>
struct int_to_str<0, Digits...>
#include <descr.h>

Public Static Attributes

static constexpr auto digits = descr<sizeof...(Digits)>(('0' + Digits)...)
class Interface
#include <gmock_link_test.h>

Subclassed by Mock

Public Functions

inline virtual ~Interface()
virtual void VoidFromString(char *str) = 0
virtual char *StringFromString(char *str) = 0
virtual int IntFromString(char *str) = 0
virtual int &IntRefFromString(char *str) = 0
virtual void VoidFromFunc(void (*func)(char *str)) = 0
virtual void VoidFromIntRef(int &n) = 0
virtual void VoidFromFloat(float n) = 0
virtual void VoidFromDouble(double n) = 0
virtual void VoidFromVector(const std::vector<int> &v) = 0
struct internals
#include <internals.h>

Internal data structure used to track registered instances and types.

Whenever binary incompatible changes are made to this structure, PYBIND11_INTERNALS_VERSION must be incremented.

Public Members

type_map<type_info*> registered_types_cpp
std::unordered_map<PyTypeObject*, std::vector<type_info*>> registered_types_py
std::unordered_multimap<const void*, instance*> registered_instances
std::unordered_set<std::pair<const PyObject*, const char*>, overload_hash> inactive_overload_cache
type_map<std::vector<bool (*)(PyObject*, void*&)>> direct_conversions
std::unordered_map<const PyObject*, std::vector<PyObject*>> patients
std::forward_list<void (*)(std::exception_ptr)> registered_exception_translators
std::unordered_map<std::string, void*> shared_data
std::vector<PyObject*> loader_patient_stack
std::forward_list<std::string> static_strings
PyTypeObject *static_property_type
PyTypeObject *default_metaclass
PyObject *instance_base
template<typename T>
struct intrinsic_type
#include <common.h>

Helper template to strip away type modifiers.

Public Types

typedef T type
typedef T type
template<typename T>
struct intrinsic_type<const T>
#include <common.h>

Public Types

typedef intrinsic_type<T>::type type
typedef intrinsic_type<T>::type type
template<typename T, size_t N>
struct intrinsic_type<const T[N]>
#include <common.h>

Public Types

typedef intrinsic_type<T>::type type
typedef intrinsic_type<T>::type type
template<typename T>
struct intrinsic_type<T&>
#include <common.h>

Public Types

typedef intrinsic_type<T>::type type
typedef intrinsic_type<T>::type type
template<typename T>
struct intrinsic_type<T&&>
#include <common.h>

Public Types

typedef intrinsic_type<T>::type type
typedef intrinsic_type<T>::type type
template<typename T>
struct intrinsic_type<T*>
#include <common.h>

Public Types

typedef intrinsic_type<T>::type type
typedef intrinsic_type<T>::type type
template<typename T, size_t N>
struct intrinsic_type<T[N]>
#include <common.h>

Public Types

typedef intrinsic_type<T>::type type
typedef intrinsic_type<T>::type type
class IntWrapper

Public Functions

inline explicit IntWrapper(int a_value)
inline IntWrapper(const IntWrapper &other)
inline IntWrapper operator=(const IntWrapper &other)
inline IntWrapper operator+(int other) const
inline bool operator<(const IntWrapper &other) const
inline int value() const

Private Members

int value_
template<std::size_t index, typename ...Params>
struct testing::internal::InvokeArgumentAction
#include <gmock-more-actions.h>

Public Functions

template<typename ...Args>
inline auto operator()(Args&&... args) const -> decltype(internal::InvokeArgument(std::get<index>(std::forward_as_tuple(std::forward<Args>(args)...)), std::declval<const Params&>()...))
template<typename ...Args>
inline auto operator()(Args&&... args) const -> decltype(internal::InvokeArgument(std::get<index>(std::forward_as_tuple(std::forward<Args>(args)...)), std::declval<const Params&>()...))

Public Members

internal::FlatTuple<Params...> params
class InvokeHelper
#include <gmock_link_test.h>

Public Functions

inline void VoidFromVoid()
inline void VoidFromString(char*)

Public Static Functions

static inline void StaticVoidFromVoid()
static inline void StaticVoidFromString(char*)
static inline int StaticIntFromString(char*)
static inline bool StaticBoolFromString(const char*)
template<class Class, typename MethodPtr>
struct testing::internal::InvokeMethodAction
#include <gmock-actions.h>

Public Functions

template<typename... Args> inline auto operator() (Args &&... args) const -> decltype((obj_ptr-> *method_ptr)(std::forward< Args >(args)...))
template<typename... Args> inline auto operator() (Args &&... args) const -> decltype((obj_ptr-> *method_ptr)(std::forward< Args >(args)...))

Public Members

Class *const obj_ptr
const MethodPtr method_ptr
template<class Class, typename MethodPtr>
struct testing::internal::InvokeMethodWithoutArgsAction
#include <gmock-actions.h>

Public Types

ReturnType = decltype((std::declval< Class * >() -> *std::declval< MethodPtr >())())
ReturnType = decltype((std::declval< Class * >() -> *std::declval< MethodPtr >())())

Public Functions

template<typename ...Args>
inline ReturnType operator()(const Args&...) const
template<typename ...Args>
inline ReturnType operator()(const Args&...) const

Public Members

Class *const obj_ptr
const MethodPtr method_ptr
template<typename FunctionImpl>
struct testing::internal::InvokeWithoutArgsAction
#include <gmock-actions.h>

Public Functions

template<typename ...Args>
inline auto operator()(const Args&...) -> decltype(function_impl())
template<typename ...Args>
inline auto operator()(const Args&...) -> decltype(function_impl())

Public Members

FunctionImpl function_impl
template<typename T, typename SFINAE = void>
struct is_comparable : public false_type, public false_type
#include <stl_bind.h>
template<typename T>
struct is_comparable<T, enable_if_t<container_traits<T>::is_element && container_traits<T>::is_comparable>> : public true_type, public true_type
#include <stl_bind.h>
template<typename T>
struct is_comparable<T, enable_if_t<container_traits<T>::is_pair>>
#include <stl_bind.h>

Public Static Attributes

static constexpr const bool value = is_comparable<typename T::first_type>::value && is_comparable<typename T::second_type>::value
template<typename T>
struct is_comparable<T, enable_if_t<container_traits<T>::is_vector>>
#include <stl_bind.h>

Public Static Attributes

static constexpr const bool value = is_comparable<typename T::value_type>::value
template<typename T>
struct is_complex : public false_type, public false_type
#include <numpy.h>
template<typename T>
struct is_complex<std::complex<T>> : public true_type, public true_type
#include <numpy.h>
template<typename T, typename SFINAE = void>
struct is_copy_assignable : public std::is_copy_assignable<T>, public std::is_copy_assignable<T>
#include <cast.h>
template<typename Container>
struct is_copy_assignable<Container, enable_if_t<all_of<std::is_copy_assignable<Container>, std::is_same<typename Container::value_type&, typename Container::reference>>::value>> : public is_copy_assignable<Container::value_type>, public is_copy_assignable<Container::value_type>
#include <cast.h>
template<typename T1, typename T2>
struct is_copy_assignable<std::pair<T1, T2>> : public all_of<is_copy_assignable<T1>, is_copy_assignable<T2>>, public all_of<is_copy_assignable<T1>, is_copy_assignable<T2>>
#include <cast.h>
template<typename T, typename SFINAE = void>
struct is_copy_constructible : public std::is_copy_constructible<T>, public std::is_copy_constructible<T>
#include <cast.h>
template<typename Container>
struct is_copy_constructible<Container, enable_if_t<all_of<std::is_copy_constructible<Container>, std::is_same<typename Container::value_type&, typename Container::reference>, negation<std::is_same<Container, typename Container::value_type>>>::value>> : public is_copy_constructible<Container::value_type>, public is_copy_constructible<Container::value_type>
#include <cast.h>
template<typename T1, typename T2>
struct is_copy_constructible<std::pair<T1, T2>> : public all_of<is_copy_constructible<T1>, is_copy_constructible<T2>>, public all_of<is_copy_constructible<T1>, is_copy_constructible<T2>>
#include <cast.h>
template<typename T, typename SFINAE = void>
struct is_fmt_numeric
#include <common.h>

Public Static Attributes

static constexpr bool value = false
template<typename T>
struct is_fmt_numeric<std::complex<T>, detail::enable_if_t<std::is_floating_point<T>::value>>
#include <complex.h>

Public Static Attributes

static constexpr bool value = true
static constexpr int index = is_fmt_numeric<T>::index + 3
template<typename T>
struct is_fmt_numeric<T, enable_if_t<std::is_arithmetic<T>::value>>
#include <common.h>

Public Static Attributes

static constexpr bool value = true
static constexpr int index   = std::is_same<T, bool>::value? 0 : 1 + (std::is_integral<T>::value ? detail::log2(sizeof(T))*2 + std::is_unsigned<T>::value: 8 + (std::is_same<T, double>::value ? 1 : std::is_same<T, long double>::value ? 2 : 0))
template<typename base, typename holder>
struct is_holder_type : public std::is_base_of<detail::type_caster_holder<base, holder>, detail::type_caster<holder>>, public std::is_base_of<detail::type_caster_holder<base, holder>, detail::type_caster<holder>>
#include <cast.h>
template<typename base, typename deleter>
struct is_holder_type<base, std::unique_ptr<base, deleter>> : public true_type, public true_type
#include <cast.h>
template<typename T, typename = void>
struct is_input_iterator : public false_type, public false_type
#include <common.h>

Check if T looks like an input iterator.

template<typename T>
struct is_input_iterator<T, void_t<decltype(*std::declval<T&>()), decltype(++std::declval<T&>())>> : public true_type, public true_type
#include <common.h>
template<template<typename...> class Class, typename T>
struct is_instantiation : public false_type, public false_type
#include <common.h>

Check if T is an instantiation of the template Class.

For example: is_instantiation<shared_ptr, T> is true if T == shared_ptr<U> where U can be anything.

template<template<typename...> class Class, typename ...Us>
struct is_instantiation<Class, Class<Us...>> : public true_type, public true_type
#include <common.h>
struct is_method
#include <attr.h>

Annotation for methods.

Public Functions

inline is_method(const handle &c)
inline is_method(const handle &c)

Public Members

handle class_
struct is_new_style_constructor
#include <attr.h>

Tag for a new-style __init__ defined in detail/init.h

struct is_operator
#include <attr.h>

Annotation for operators.

template<typename T>
struct is_std_array : public false_type, public false_type
#include <numpy.h>
template<typename T, size_t N>
struct is_std_array<std::array<T, N>> : public true_type, public true_type
#include <numpy.h>
template<template<typename...> class Base>
struct is_template_base_of_impl
#include <common.h>

Public Static Functions

template<typename ...Us>
static std::true_type check(Base<Us...>*)
static std::false_type check(...)
template<typename ...Us>
static std::true_type check(Base<Us...>*)
static std::false_type check(...)
template<typename T>
struct is_valid_class_option : public detail::any_of<is_holder<T>, is_subtype<T>, is_base<T>>, public detail::any_of<is_holder<T>, is_subtype<T>, is_base<T>>
class iterable : public object, public object
#include <pytypes.h>
struct values_and_holders::iterator
#include <cast.h>

Public Functions

inline bool operator==(const iterator &other)
inline bool operator!=(const iterator &other)
inline iterator &operator++()
inline value_and_holder &operator*()
inline value_and_holder *operator->()
inline bool operator==(const iterator &other)
inline bool operator!=(const iterator &other)
inline iterator &operator++()
inline value_and_holder &operator*()
inline value_and_holder *operator->()

Private Functions

inline iterator(instance *inst, const type_vec *tinfo)
inline iterator(size_t end)
inline iterator(instance *inst, const type_vec *tinfo)
inline iterator(size_t end)

Private Members

instance *inst = nullptr
const type_vec *types = nullptr
value_and_holder curr

Friends

friend struct values_and_holders
struct foo::PathLike::iterator

Public Types

typedef PathLike value_type

Public Functions

iterator &operator++()
PathLike &operator*()
struct testing::gtest_printers_test::iterator

Public Members

char x
class iterator : public object, public object
#include <pytypes.h>

Wraps a Python iterator so that it can also be used as a C++ input iterator

Caveat: copying an iterator does not (and cannot) clone the internal state of the Python iterable. This also applies to the post-increment operator. This iterator should only be used to retrieve the current value using operator*().

Public Types

using iterator_category = std::input_iterator_tag
using difference_type = ssize_t
using value_type = handle
using reference = const handle
using pointer = const handle*
using iterator_category = std::input_iterator_tag
using difference_type = ssize_t
using value_type = handle
using reference = const handle
using pointer = const handle*

Public Functions

inline iterator &operator++()
inline iterator operator++(int)
inline reference operator*() const
inline pointer operator->() const
inline iterator &operator++()
inline iterator operator++(int)
inline reference operator*() const
inline pointer operator->() const

Public Static Functions

static inline iterator sentinel()

The value which marks the end of the iteration.

it == iterator::sentinel() is equivalent to catching StopIteration in Python.

.. code-block:: cpp

void foo(py::iterator it) {
    while (it != py::iterator::sentinel()) {
use *it ++it; } }

static inline iterator sentinel()

The value which marks the end of the iteration.

it == iterator::sentinel() is equivalent to catching StopIteration in Python.

.. code-block:: cpp

void foo(py::iterator it) {
    while (it != py::iterator::sentinel()) {
use *it ++it; } }

Private Functions

inline void advance()
inline void advance()

Private Members

object value = {}

Friends

inline friend friend bool operator== (const iterator &a, const iterator &b)
inline friend friend bool operator!= (const iterator &a, const iterator &b)
inline friend friend bool operator== (const iterator &a, const iterator &b)
inline friend friend bool operator!= (const iterator &a, const iterator &b)
template<typename Iterator, typename Sentinel, bool KeyIterator, return_value_policy Policy>
struct iterator_state
#include <pybind11.h>

Public Members

Iterator it
Sentinel end
bool first_or_done
class testing::internal::JsonUnitTestResultPrinter : public testing::EmptyTestEventListener

Public Functions

explicit JsonUnitTestResultPrinter(const char *output_file)
virtual void OnTestIterationEnd(const UnitTest &unit_test, int iteration) override

Public Static Functions

static void PrintJsonTestList(::std::ostream *stream, const std::vector<TestSuite*> &test_suites)

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(JsonUnitTestResultPrinter)

Private Members

const std::string output_file_

Private Static Functions

static std::string EscapeJson(const std::string &str)
static void OutputJsonKey(std::ostream *stream, const std::string &element_name, const std::string &name, const std::string &value, const std::string &indent, bool comma = true)
static void OutputJsonKey(std::ostream *stream, const std::string &element_name, const std::string &name, int value, const std::string &indent, bool comma = true)
static void OutputJsonTestSuiteForTestResult(::std::ostream *stream, const TestResult &result)
static void OutputJsonTestResult(::std::ostream *stream, const TestResult &result)
static void OutputJsonTestInfo(::std::ostream *stream, const char *test_suite_name, const TestInfo &test_info)
static void PrintJsonTestSuite(::std::ostream *stream, const TestSuite &test_suite)
static void PrintJsonUnitTest(::std::ostream *stream, const UnitTest &unit_test)
static std::string TestPropertiesAsJson(const TestResult &result, const std::string &indent)
template<size_t Nurse, size_t Patient>
struct keep_alive
#include <attr.h>

Keep patient alive while nurse lives.

class kwargs : public dict, public dict
#include <pytypes.h>
class kwargs_proxy : public handle, public handle
#include <pytypes.h>

Public Functions

inline explicit kwargs_proxy(handle h)
inline explicit kwargs_proxy(handle h)
class testing::gmock_function_mocker_test::LegacyMockB

Public Functions

inline LegacyMockB()
MOCK_METHOD0(DoB, void())

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(LegacyMockB)
class testing::gmock_function_mocker_test::LegacyMockFoo : public testing::gmock_function_mocker_test::FooInterface

Public Functions

inline LegacyMockFoo()
MOCK_METHOD1(VoidReturning, void(int n))
MOCK_METHOD0(Nullary, int())
MOCK_METHOD1(Unary, bool(int))
MOCK_METHOD2(Binary, long(short, int))
MOCK_METHOD10(Decimal, int(bool, char, short, int, long, float, double, unsigned, char*, const std::string &str))
MOCK_METHOD1(TakesNonConstReference, bool(int&))
MOCK_METHOD1(TakesConstReference, std::string(const int&))
MOCK_METHOD1(TakesConst, bool(const int))
MOCK_METHOD0(ReturnTypeWithComma, std::map<int, std::string>())
MOCK_CONST_METHOD1(ReturnTypeWithComma, std::map<int, std::string>(int))
MOCK_METHOD0(OverloadedOnArgumentNumber, int())
MOCK_METHOD1(OverloadedOnArgumentNumber, int(int))
MOCK_METHOD1(OverloadedOnArgumentType, int(int))
MOCK_METHOD1(OverloadedOnArgumentType, char(char))
MOCK_METHOD0(OverloadedOnConstness, int())
MOCK_CONST_METHOD0(OverloadedOnConstness, char())
MOCK_METHOD1(TypeWithHole, int(int (*)()))
MOCK_METHOD1(TypeWithComma, int(const std::map<int, std::string>&))
MOCK_METHOD1(TypeWithTemplatedCopyCtor, int(const TemplatedCopyable<int>&))
MOCK_METHOD1(ReturnsFunctionPointer1, int (*(int))(bool))
MOCK_METHOD1(ReturnsFunctionPointer2, fn_ptr(int))
inline virtual int RefQualifiedConstRef() const & override
inline virtual int RefQualifiedConstRefRef() const && override
inline virtual int RefQualifiedRef() & override
inline virtual int RefQualifiedRefRef() && override
inline virtual int RefQualifiedOverloaded() const & override
inline virtual int RefQualifiedOverloaded() const && override
inline virtual int RefQualifiedOverloaded() & override
inline virtual int RefQualifiedOverloaded() && override

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(LegacyMockFoo)
struct testing::gmock_function_mocker_test::LegacyMockMethodSizes0

Public Functions

MOCK_METHOD0(func, void())
struct testing::gmock_function_mocker_test::LegacyMockMethodSizes1

Public Functions

MOCK_METHOD1(func, void(int))
struct testing::gmock_function_mocker_test::LegacyMockMethodSizes2

Public Functions

MOCK_METHOD2(func, void(int, int))
struct testing::gmock_function_mocker_test::LegacyMockMethodSizes3

Public Functions

MOCK_METHOD3(func, void(int, int, int))
struct testing::gmock_function_mocker_test::LegacyMockMethodSizes4

Public Functions

MOCK_METHOD4(func, void(int, int, int, int))
class testing::gmock_function_mocker_test::LegacyMockOverloadedOnArgNumber

Public Functions

inline LegacyMockOverloadedOnArgNumber()

Public Members

LEGACY_MY_MOCK_METHODS1_

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(LegacyMockOverloadedOnArgNumber)
template<typename T>
class testing::gmock_function_mocker_test::LegacyMockStack : public testing::gmock_function_mocker_test::StackInterface<T>

Public Functions

inline LegacyMockStack()
MOCK_METHOD1_T(Push, void(const T &elem))
MOCK_METHOD0_T(Pop, void())
MOCK_CONST_METHOD0_T(GetSize, int())
MOCK_CONST_METHOD0_T(GetTop, const T&())
MOCK_METHOD0_T(ReturnTypeWithComma, std::map<int, int>())
MOCK_CONST_METHOD1_T(ReturnTypeWithComma, std::map<int, int>(int))

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(LegacyMockStack)
template<typename T>
struct testing::internal::LessByName

Public Functions

inline bool operator()(const T *a, const T *b)
class list : public object, public object
#include <pytypes.h>

Public Functions

inline explicit list(size_t size = 0)
inline size_t size() const
inline bool empty() const
inline detail::list_accessor operator[](size_t index) const
inline detail::item_accessor operator[](handle h) const
inline detail::list_iterator begin() const
inline detail::list_iterator end() const
template<typename T>
inline void append(T &&val) const
template<typename T>
inline void insert(size_t index, T &&val) const
inline explicit list(size_t size = 0)
inline size_t size() const
inline bool empty() const
inline detail::list_accessor operator[](size_t index) const
inline detail::item_accessor operator[](handle h) const
inline detail::list_iterator begin() const
inline detail::list_iterator end() const
template<typename T>
inline void append(T &&val) const
template<typename T>
inline void insert(size_t index, T &&val) const
template<typename Type, typename Value>
struct list_caster
#include <stl.h>

Public Types

using value_conv = make_caster<Value>
using value_conv = make_caster<Value>

Public Functions

inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (Type, _("List[")+value_conv::name+_("]"))
inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (Type, _("List[")+value_conv::name+_("]"))

Public Static Functions

template<typename T>
static inline handle cast(T &&src, return_value_policy policy, handle parent)
template<typename T>
static inline handle cast(T &&src, return_value_policy policy, handle parent)

Private Functions

template<typename T = Type, enable_if_t<std::is_same<decltype(std::declval<T>().reserve(0)), void>::value, int> = 0>
inline void reserve_maybe(sequence s, Type*)
inline void reserve_maybe(sequence, void*)
template<typename T = Type, enable_if_t<std::is_same<decltype(std::declval<T>().reserve(0)), void>::value, int> = 0>
inline void reserve_maybe(sequence s, Type*)
inline void reserve_maybe(sequence, void*)
struct list_item
#include <pytypes.h>

Public Types

using key_type = size_t
using key_type = size_t

Public Static Functions

static inline object get(handle obj, size_t index)
static inline void set(handle obj, size_t index, handle val)
static inline object get(handle obj, size_t index)
static inline void set(handle obj, size_t index, handle val)
class testing::internal::ListenerTest : public testing::Test

Protected Functions

inline virtual void SetUp() override
inline virtual void TearDown() override

Protected Static Functions

static inline void SetUpTestSuite()
static inline void TearDownTestSuite()
class loader_life_support
#include <cast.h>

A life support system for temporary objects created by type_caster::load().

Adding a patient will keep it alive up until the enclosing function returns.

Public Functions

inline loader_life_support()

A new patient frame is created when a function is entered.

inline ~loader_life_support()

… and destroyed after it returns

inline loader_life_support()

A new patient frame is created when a function is entered.

inline ~loader_life_support()

… and destroyed after it returns

Public Static Functions

static inline PYBIND11_NOINLINE void add_patient (handle h)

This can only be used inside a pybind11-bound function, either by argument_loader at argument preparation time or by py::cast() at execution time.

static inline PYBIND11_NOINLINE void add_patient (handle h)

This can only be used inside a pybind11-bound function, either by argument_loader at argument preparation time or by py::cast() at execution time.

struct LookupBlocker
#include <gtest-printers.h>
class MacroNamingTest : public testing::TestWithParam<int>
class MacroNamingTestNonParametrized : public testing::Test
template<size_t N, size_t... S>
struct make_index_sequence_impl
#include <common.h>
template<size_t... S>
struct make_index_sequence_impl<0, S...>
#include <common.h>

Public Types

typedef index_sequence<S...> type
typedef index_sequence<S...> type
template<typename Type, typename Key, typename Value>
struct map_caster
#include <stl.h>

Public Types

using key_conv = make_caster<Key>
using value_conv = make_caster<Value>
using key_conv = make_caster<Key>
using value_conv = make_caster<Value>

Public Functions

inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (Type, _("Dict[")+key_conv::name+_(", ")+value_conv::name+_("]"))
inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (Type, _("Dict[")+key_conv::name+_(", ")+value_conv::name+_("]"))

Public Static Functions

template<typename T>
static inline handle cast(T &&src, return_value_policy policy, handle parent)
template<typename T>
static inline handle cast(T &&src, return_value_policy policy, handle parent)
class testing::internal::MaxBipartiteMatchState

Public Functions

inline explicit MaxBipartiteMatchState(const MatchMatrix &graph)
inline ElementMatcherPairs Compute()

Private Functions

inline bool TryAugment(size_t ilhs, ::std::vector<char> *seen)

Private Members

const MatchMatrix *graph_
::std::vector<size_t> left_
::std::vector<size_t> right_

Private Static Attributes

static const size_t kUnused = static_cast<size_t>(-1)
class memoryview : public object, public object
#include <pytypes.h>

Public Functions

inline explicit memoryview(const buffer_info &info)
inline explicit memoryview(const buffer_info &info)
class Message
class testing::Message
#include <gtest-message.h>

Public Functions

Message()
inline Message(const Message &msg)
inline explicit Message(const char *str)
template<typename T>
inline Message &operator<<(const T &val)
template<typename T>
inline Message &operator<<(T *const &pointer)
inline Message &operator<<(BasicNarrowIoManip val)
inline Message &operator<<(bool b)
Message &operator<<(const wchar_t *wide_c_str)
Message &operator<<(wchar_t *wide_c_str)
std::string GetString() const
Message()
inline Message(const Message &msg)
inline explicit Message(const char *str)
template<typename T>
inline Message &operator<<(const T &val)
template<typename T>
inline Message &operator<<(T *const &pointer)
inline Message &operator<<(BasicNarrowIoManip val)
inline Message &operator<<(bool b)
Message &operator<<(const wchar_t *wide_c_str)
Message &operator<<(wchar_t *wide_c_str)
std::string GetString() const

Private Types

typedef std::ostream &(*BasicNarrowIoManip)(std::ostream&)
typedef std::ostream &(*BasicNarrowIoManip)(std::ostream&)

Private Functions

void operator=(const Message&)
void operator=(const Message&)

Private Members

const std::unique_ptr<::std::stringstream> ss_
struct metaclass
#include <attr.h>

Annotation which requests that a special metaclass is created for a type.

Public Functions

inline metaclass()
inline explicit metaclass(handle value)

Override pybind11’s default metaclass.

inline metaclass()
inline explicit metaclass(handle value)

Override pybind11’s default metaclass.

Public Members

handle value
struct MissingDebugStringMethod

Public Functions

inline std::string DebugString()
class MixedUpTestSuiteTest : public testing::Test
class MixedUpTestSuiteTest : public testing::Test
class MixedUpTestSuiteWithSameTestNameTest : public testing::Test
class MixedUpTestSuiteWithSameTestNameTest : public testing::Test
class Mock : public Interface
#include <gmock_link_test.h>

Public Functions

inline Mock()
MOCK_METHOD0(DoThis, void())
inline Mock()
MOCK_METHOD1(VoidFromString, void(char *str))
MOCK_METHOD1(StringFromString, char*(char *str))
MOCK_METHOD1(IntFromString, int(char *str))
MOCK_METHOD1(IntRefFromString, int&(char *str))
MOCK_METHOD1(VoidFromFunc, void(void (*func)(char *str)))
MOCK_METHOD1(VoidFromIntRef, void(int &n))
MOCK_METHOD1(VoidFromFloat, void(float n))
MOCK_METHOD1(VoidFromDouble, void(double n))
MOCK_METHOD1(VoidFromVector, void(const std::vector<int> &v))

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(Mock)
GTEST_DISALLOW_COPY_AND_ASSIGN_(Mock)
class testing::gmock_function_mocker_test::MockB

Public Functions

inline MockB()
MOCK_METHOD (void, DoB,())

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(MockB)
class testing::gmock_nice_strict_test::MockBar

Public Functions

inline explicit MockBar(const std::string &s)
inline MockBar(char a1, char a2, std::string a3, std::string a4, int a5, int a6, const std::string &a7, const std::string &a8, bool a9, bool a10)
inline virtual ~MockBar()
inline const std::string &str() const
MOCK_METHOD0(This, int())
MOCK_METHOD2(That, std::string(int, bool))

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(MockBar)

Private Members

std::string str_
class testing::gmock_nice_strict_test::MockBaz

Public Functions

inline MockBaz(MoveOnly)
class testing::gmock_nice_strict_test::MockFoo : public testing::gmock_nice_strict_test::Foo

Public Functions

inline MockFoo()
inline void Delete()
MOCK_METHOD0(DoThis, void())
MOCK_METHOD1(DoThat, int(bool flag))
MOCK_METHOD0(ReturnNonDefaultConstructible, NotDefaultConstructible())

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo)
class MockFoo : public FooInterface

Public Functions

inline MockFoo()
MOCK_METHOD3(Bar, char(const std::string &s, int i, double x))
MOCK_METHOD2(Bar2, bool(int x, int y))
MOCK_METHOD2(Bar3, void(int x, int y))

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo)
class testing::gmock_function_mocker_test::MockFoo : public testing::gmock_function_mocker_test::FooInterface

Public Functions

inline MockFoo()
MOCK_METHOD (void, VoidReturning,(int n))
MOCK_METHOD (int, Nullary,())
MOCK_METHOD (bool, Unary,(int))
MOCK_METHOD (long, Binary,(short, int))
MOCK_METHOD (int, Decimal,(bool, char, short, int, long, float, double, unsigned, char *, const std::string &str),(override))
MOCK_METHOD (bool, TakesNonConstReference,(int &))
MOCK_METHOD (std::string, TakesConstReference,(const int &))
MOCK_METHOD (bool, TakesConst,(const int))
MOCK_METHOD ((std::map< int, std::string >), ReturnTypeWithComma,(),())
MOCK_METHOD ((std::map< int, std::string >), ReturnTypeWithComma,(int),(const))
MOCK_METHOD (int, OverloadedOnArgumentNumber,())
MOCK_METHOD (int, OverloadedOnArgumentNumber,(int))
MOCK_METHOD (int, OverloadedOnArgumentType,(int))
MOCK_METHOD (char, OverloadedOnArgumentType,(char))
MOCK_METHOD (int, OverloadedOnConstness,(),(override))
MOCK_METHOD (char, OverloadedOnConstness,(),(override, const))
MOCK_METHOD (int, TypeWithHole,(int(*)()),())
MOCK_METHOD (int, TypeWithComma,((const std::map< int, std::string > &)))
MOCK_METHOD (int, TypeWithTemplatedCopyCtor,(const TemplatedCopyable< int > &))
MOCK_METHOD (int(*)(bool), ReturnsFunctionPointer1,(int),())
MOCK_METHOD (fn_ptr, ReturnsFunctionPointer2,(int),())
MOCK_METHOD (int, RefQualifiedConstRef,(),(const, ref(&), override))
MOCK_METHOD (int, RefQualifiedConstRefRef,(),(const, ref(&&), override))
MOCK_METHOD (int, RefQualifiedRef,(),(ref(&), override))
MOCK_METHOD (int, RefQualifiedRefRef,(),(ref(&&), override))
MOCK_METHOD (int, RefQualifiedOverloaded,(),(const, ref(&), override))
MOCK_METHOD (int, RefQualifiedOverloaded,(),(const, ref(&&), override))
MOCK_METHOD (int, RefQualifiedOverloaded,(),(ref(&), override))
MOCK_METHOD (int, RefQualifiedOverloaded,(),(ref(&&), override))

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo)
template<typename F>
class MockMethodMockFunctionSignatureTest : public testing::Test
struct testing::gmock_function_mocker_test::MockMethodNoexceptSpecifier

Public Functions

MOCK_METHOD (void, func1,(),(noexcept))
MOCK_METHOD (void, func2,(),(noexcept(true)))
MOCK_METHOD (void, func3,(),(noexcept(false)))
MOCK_METHOD (void, func4,(),(noexcept(noexcept(MaybeThrows()))))
MOCK_METHOD (void, func5,(),(noexcept(noexcept(DoesntThrow()))))
MOCK_METHOD (void, func6,(),(noexcept(noexcept(DoesntThrow())), const))
MOCK_METHOD (void, func7,(),(const, noexcept(noexcept(DoesntThrow()))))
MOCK_METHOD (void, func8,(),(noexcept(noexcept(hasTwoParams(1, 2))), const))
struct testing::gmock_function_mocker_test::MockMethodSizes0

Public Functions

MOCK_METHOD (void, func,())
struct testing::gmock_function_mocker_test::MockMethodSizes1

Public Functions

MOCK_METHOD (void, func,(int))
struct testing::gmock_function_mocker_test::MockMethodSizes2

Public Functions

MOCK_METHOD (void, func,(int, int))
struct testing::gmock_function_mocker_test::MockMethodSizes3

Public Functions

MOCK_METHOD (void, func,(int, int, int))
struct testing::gmock_function_mocker_test::MockMethodSizes4

Public Functions

MOCK_METHOD (void, func,(int, int, int, int))
class testing::gmock_function_mocker_test::MockOverloadedOnArgNumber

Public Functions

inline MockOverloadedOnArgNumber()

Public Members

MY_MOCK_METHODS1_

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(MockOverloadedOnArgNumber)
class testing::gmock_function_mocker_test::MockOverloadedOnConstness

Public Functions

inline MockOverloadedOnConstness()

Public Members

MY_MOCK_METHODS2_

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(MockOverloadedOnConstness)
template<typename T>
class testing::gmock_function_mocker_test::MockStack : public testing::gmock_function_mocker_test::StackInterface<T>

Public Functions

inline MockStack()
MOCK_METHOD (void, Push,(const T &elem),())
MOCK_METHOD (void, Pop,(),(final))
MOCK_METHOD (int, GetSize,(),(const, override))
MOCK_METHOD (const T &, GetTop,(),(const))
MOCK_METHOD ((std::map< int, int >), ReturnTypeWithComma,(),())
MOCK_METHOD ((std::map< int, int >), ReturnTypeWithComma,(int),(const))

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(MockStack)
class module : public object, public object
#include <pybind11.h>

Wrapper for Python extension modules.

Public Functions

inline explicit module(const char *name, const char *doc = nullptr)

Create a new top-level Python module with the given name and docstring.

template<typename Func, typename ...Extra>
inline module &def(const char *name_, Func &&f, const Extra&... extra)

Create Python binding for a new function within the module scope.

Func can be a plain C++ function, a function pointer, or a lambda function. For details on the Extra&& ... extra argument, see section :ref:extras.

inline module def_submodule(const char *name, const char *doc = nullptr)

Create and return a new Python submodule with the given name and docstring.

This also works recursively, i.e.

.. code-block:: cpp

py::module m("example", "pybind11 example plugin");
py::module m2 = m.def_submodule("sub", "A submodule of 'example'");
py::module m3 = m2.def_submodule("subsub", "A submodule of 'example.sub'");

inline void reload()

Reload the module or throws error_already_set.

inline PYBIND11_NOINLINE void add_object (const char *name, handle obj, bool overwrite=false)
inline explicit module(const char *name, const char *doc = nullptr)

Create a new top-level Python module with the given name and docstring.

template<typename Func, typename ...Extra>
inline module &def(const char *name_, Func &&f, const Extra&... extra)

Create Python binding for a new function within the module scope.

Func can be a plain C++ function, a function pointer, or a lambda function. For details on the Extra&& ... extra argument, see section :ref:extras.

inline module def_submodule(const char *name, const char *doc = nullptr)

Create and return a new Python submodule with the given name and docstring.

This also works recursively, i.e.

.. code-block:: cpp

py::module m("example", "pybind11 example plugin");
py::module m2 = m.def_submodule("sub", "A submodule of 'example'");
py::module m3 = m2.def_submodule("subsub", "A submodule of 'example.sub'");

inline void reload()

Reload the module or throws error_already_set.

inline PYBIND11_NOINLINE void add_object (const char *name, handle obj, bool overwrite=false)

Public Static Functions

static inline module import(const char *name)

Import and return a module or throws error_already_set.

static inline module import(const char *name)

Import and return a module or throws error_already_set.

struct module_local
#include <attr.h>

Annotation that marks a class as local to the module:

Public Functions

inline constexpr module_local(bool v = true)
inline constexpr module_local(bool v = true)

Public Members

const bool value
template<typename F>
class testing::PolymorphicAction::MonomorphicImpl : public testing::ActionInterface<F>, public testing::ActionInterface<F>

Public Types

typedef internal::Function<F>::Result Result
typedef internal::Function<F>::ArgumentTuple ArgumentTuple
typedef internal::Function<F>::Result Result
typedef internal::Function<F>::ArgumentTuple ArgumentTuple

Public Functions

inline explicit MonomorphicImpl(const Impl &impl)
inline virtual Result Perform(const ArgumentTuple &args) override
inline explicit MonomorphicImpl(const Impl &impl)
inline virtual Result Perform(const ArgumentTuple &args) override

Private Members

Impl impl_
template<class T>
struct MovableEigenMatrix
#include <yaml_eigen.hpp>
template<class T>
struct MovableEigenVector
#include <yaml_eigen.hpp>
template<typename T, typename SFINAE = void>
struct move_always : public false_type, public false_type
#include <cast.h>
template<typename T>
struct move_always<T, enable_if_t<all_of<move_is_plain_type<T>, negation<is_copy_constructible<T>>, std::is_move_constructible<T>, std::is_same<decltype(std::declval<make_caster<T>>().operator T&()), T&>>::value>> : public true_type, public true_type
#include <cast.h>
template<typename T, typename SFINAE = void>
struct move_if_unreferenced : public false_type, public false_type
#include <cast.h>
template<typename T>
struct move_if_unreferenced<T, enable_if_t<all_of<move_is_plain_type<T>, negation<move_always<T>>, std::is_move_constructible<T>, std::is_same<decltype(std::declval<make_caster<T>>().operator T&()), T&>>::value>> : public true_type, public true_type
#include <cast.h>
template<typename type, typename holder_type>
struct move_only_holder_caster
#include <cast.h>

Public Static Functions

static inline handle cast(holder_type &&src, return_value_policy, handle)
static inline handle cast(holder_type &&src, return_value_policy, handle)

Public Static Attributes

static constexpr auto name = type_caster_base<type>::name
class testing::gmock_nice_strict_test::MockBaz::MoveOnly

Public Functions

MoveOnly() = default
MoveOnly(const MoveOnly&) = delete
MoveOnly &operator=(const MoveOnly&) = delete
MoveOnly(MoveOnly&&) = default
MoveOnly &operator=(MoveOnly&&) = default
template<size_t N>
class multi_array_iterator
#include <numpy.h>

Public Types

using container_type = std::vector<ssize_t>
using container_type = std::vector<ssize_t>

Public Functions

inline multi_array_iterator(const std::array<buffer_info, N> &buffers, const container_type &shape)
inline multi_array_iterator &operator++()
template<size_t K, class T = void>
inline T *data() const
inline multi_array_iterator(const std::array<buffer_info, N> &buffers, const container_type &shape)
inline multi_array_iterator &operator++()
template<size_t K, class T = void>
inline T *data() const

Private Types

using common_iter = common_iterator
using common_iter = common_iterator

Private Functions

inline void init_common_iterator(const buffer_info &buffer, const container_type &shape, common_iter &iterator, container_type &strides)
inline void increment_common_iterator(size_t dim)
inline void init_common_iterator(const buffer_info &buffer, const container_type &shape, common_iter &iterator, container_type &strides)
inline void increment_common_iterator(size_t dim)

Private Members

container_type m_shape
container_type m_index
std::array<common_iter, N> m_common_iterator
struct multiple_inheritance
#include <attr.h>

Annotation indicating that a class is involved in a multiple inheritance relationship.

class MultipleInstantiationTest : public testing::TestWithParam<int>
template<typename T, int kSize>
class MyArray
class MyEnumTest : public testing::TestWithParam<MyEnums>
template<typename T1, typename T2>
struct MyPair
class MyString
#include <sample2.h>

Public Functions

inline MyString()
inline explicit MyString(const char *a_c_string)
inline MyString(const MyString &string)
inline ~MyString()
inline const char *c_string() const
inline size_t Length() const
void Set(const char *c_string)

Public Static Functions

static const char *CloneCString(const char *a_c_string)

Private Functions

const MyString &operator=(const MyString &rhs)

Private Members

const char *c_string_
class MyType

Public Functions

inline explicit MyType(const std::string &a_value)
inline const std::string &value() const

Private Members

std::string value_
class namespace1::MyTypeInNameSpace1 : public Base

Public Functions

inline explicit MyTypeInNameSpace1(int an_x)
class namespace2::MyTypeInNameSpace2 : public Base

Public Functions

inline explicit MyTypeInNameSpace2(int an_x)
template<class MockClass>
class testing::NaggyMock : private testing::internal::NaggyMockImpl<MockClass>, public MockClass, private testing::internal::NaggyMockImpl<MockClass>, public MockClass
#include <gmock-nice-strict.h>

Public Functions

inline NaggyMock()
template<typename A>
inline explicit NaggyMock(A &&arg)
template<typename TArg1, typename TArg2, typename ...An>
inline NaggyMock(TArg1 &&arg1, TArg2 &&arg2, An&&... args)
inline NaggyMock()
template<typename A>
inline explicit NaggyMock(A &&arg)
template<typename TArg1, typename TArg2, typename ...An>
inline NaggyMock(TArg1 &&arg1, TArg2 &&arg2, An&&... args)

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(NaggyMock)
GTEST_DISALLOW_COPY_AND_ASSIGN_(NaggyMock)
template<typename Base>
class testing::internal::NaggyMockImpl
#include <gmock-nice-strict.h>

Public Functions

inline NaggyMockImpl()
inline ~NaggyMockImpl()
inline NaggyMockImpl()
inline ~NaggyMockImpl()
struct name
#include <attr.h>

Annotation for function names.

Public Functions

inline name(const char *value)
inline name(const char *value)

Public Members

const char *value
class NamingTest : public testing::TestWithParam<int>
template<typename T>
struct negation : public bool_constant<!T::value>, public bool_constant<!T::value>
#include <common.h>
template<class MockClass>
class testing::NiceMock : private testing::internal::NiceMockImpl<MockClass>, public MockClass, private testing::internal::NiceMockImpl<MockClass>, public MockClass
#include <gmock-nice-strict.h>

Public Functions

inline NiceMock()
template<typename A>
inline explicit NiceMock(A &&arg)
template<typename TArg1, typename TArg2, typename ...An>
inline NiceMock(TArg1 &&arg1, TArg2 &&arg2, An&&... args)
inline NiceMock()
template<typename A>
inline explicit NiceMock(A &&arg)
template<typename TArg1, typename TArg2, typename ...An>
inline NiceMock(TArg1 &&arg1, TArg2 &&arg2, An&&... args)

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(NiceMock)
GTEST_DISALLOW_COPY_AND_ASSIGN_(NiceMock)
template<typename Base>
class testing::internal::NiceMockImpl
#include <gmock-nice-strict.h>

Public Functions

inline NiceMockImpl()
inline ~NiceMockImpl()
inline NiceMockImpl()
inline ~NiceMockImpl()
class testing::internal::NoDefaultContructor

Public Functions

inline explicit NoDefaultContructor(const char*)
inline NoDefaultContructor(const NoDefaultContructor&)
struct nodelete
#include <common.h>

Dummy destructor wrapper that can be used to expose classes with a private destructor.

Public Functions

template<typename T>
inline void operator()(T*)
template<typename T>
inline void operator()(T*)
class NonContainer
class NonDefaultConstructAssignString

Public Functions

inline NonDefaultConstructAssignString(const std::string &s)
NonDefaultConstructAssignString() = delete
NonDefaultConstructAssignString(const NonDefaultConstructAssignString&) = default
NonDefaultConstructAssignString &operator=(const NonDefaultConstructAssignString&) = delete
~NonDefaultConstructAssignString() = default
inline const std::string &str() const

Private Members

std::string str_
class none : public object, public object
#include <pytypes.h>

Public Functions

inline none()
inline none()
class NonFatalFailureInFixtureConstructorTest : public testing::Test

Protected Functions

inline NonFatalFailureInFixtureConstructorTest()
inline ~NonFatalFailureInFixtureConstructorTest() override
inline virtual void SetUp() override
inline virtual void TearDown() override
class NonFatalFailureInSetUpTest : public testing::Test

Protected Functions

inline ~NonFatalFailureInSetUpTest() override
inline virtual void SetUp() override
inline virtual void TearDown() override

Private Functions

inline void Deinit()
class NonParameterizedBaseTest : public testing::Test

Subclassed by ParameterizedDerivedTest

Public Functions

inline NonParameterizedBaseTest()

Protected Attributes

int n_
struct nonsimple_values_and_holders
#include <common.h>

Public Members

void **values_and_holders
uint8_t *status
struct NotConstDebugStringMethod

Public Functions

inline std::string DebugString()
inline std::string ShortDebugString() const
class testing::gmock_nice_strict_test::NotDefaultConstructible

Public Functions

inline explicit NotDefaultConstructible(int)
class NotInstantiatedTest : public testing::TestWithParam<int>
template<typename T>
class NotInstantiatedTypeTest : public testing::Test
struct NotReallyAHashTable

Public Types

typedef void hasher
typedef void reverse_iterator
class NotUsedTest : public testing::TestWithParam<int>
template<typename T>
class NotUsedTypeTest : public testing::Test
struct npy_api
#include <numpy.h>

Public Types

enum constants

Values:

enumerator NPY_ARRAY_C_CONTIGUOUS_
enumerator NPY_ARRAY_F_CONTIGUOUS_
enumerator NPY_ARRAY_OWNDATA_
enumerator NPY_ARRAY_FORCECAST_
enumerator NPY_ARRAY_ENSUREARRAY_
enumerator NPY_ARRAY_ALIGNED_
enumerator NPY_ARRAY_WRITEABLE_
enumerator NPY_BOOL_
enumerator NPY_BYTE_
enumerator NPY_UBYTE_
enumerator NPY_SHORT_
enumerator NPY_USHORT_
enumerator NPY_INT_
enumerator NPY_UINT_
enumerator NPY_LONG_
enumerator NPY_ULONG_
enumerator NPY_LONGLONG_
enumerator NPY_ULONGLONG_
enumerator NPY_FLOAT_
enumerator NPY_DOUBLE_
enumerator NPY_LONGDOUBLE_
enumerator NPY_CFLOAT_
enumerator NPY_CDOUBLE_
enumerator NPY_CLONGDOUBLE_
enumerator NPY_OBJECT_
enumerator NPY_STRING_
enumerator NPY_UNICODE_
enumerator NPY_VOID_
enumerator NPY_INT8_
enumerator NPY_UINT8_
enumerator NPY_INT16_
enumerator NPY_UINT16_
enumerator NPY_INT32_
enumerator NPY_UINT32_
enumerator NPY_INT64_
enumerator NPY_UINT64_
enumerator NPY_ARRAY_C_CONTIGUOUS_
enumerator NPY_ARRAY_F_CONTIGUOUS_
enumerator NPY_ARRAY_OWNDATA_
enumerator NPY_ARRAY_FORCECAST_
enumerator NPY_ARRAY_ENSUREARRAY_
enumerator NPY_ARRAY_ALIGNED_
enumerator NPY_ARRAY_WRITEABLE_
enumerator NPY_BOOL_
enumerator NPY_BYTE_
enumerator NPY_UBYTE_
enumerator NPY_SHORT_
enumerator NPY_USHORT_
enumerator NPY_INT_
enumerator NPY_UINT_
enumerator NPY_LONG_
enumerator NPY_ULONG_
enumerator NPY_LONGLONG_
enumerator NPY_ULONGLONG_
enumerator NPY_FLOAT_
enumerator NPY_DOUBLE_
enumerator NPY_LONGDOUBLE_
enumerator NPY_CFLOAT_
enumerator NPY_CDOUBLE_
enumerator NPY_CLONGDOUBLE_
enumerator NPY_OBJECT_
enumerator NPY_STRING_
enumerator NPY_UNICODE_
enumerator NPY_VOID_
enumerator NPY_INT8_
enumerator NPY_UINT8_
enumerator NPY_INT16_
enumerator NPY_UINT16_
enumerator NPY_INT32_
enumerator NPY_UINT32_
enumerator NPY_INT64_
enumerator NPY_UINT64_
enum constants

Values:

enumerator NPY_ARRAY_C_CONTIGUOUS_
enumerator NPY_ARRAY_F_CONTIGUOUS_
enumerator NPY_ARRAY_OWNDATA_
enumerator NPY_ARRAY_FORCECAST_
enumerator NPY_ARRAY_ENSUREARRAY_
enumerator NPY_ARRAY_ALIGNED_
enumerator NPY_ARRAY_WRITEABLE_
enumerator NPY_BOOL_
enumerator NPY_BYTE_
enumerator NPY_UBYTE_
enumerator NPY_SHORT_
enumerator NPY_USHORT_
enumerator NPY_INT_
enumerator NPY_UINT_
enumerator NPY_LONG_
enumerator NPY_ULONG_
enumerator NPY_LONGLONG_
enumerator NPY_ULONGLONG_
enumerator NPY_FLOAT_
enumerator NPY_DOUBLE_
enumerator NPY_LONGDOUBLE_
enumerator NPY_CFLOAT_
enumerator NPY_CDOUBLE_
enumerator NPY_CLONGDOUBLE_
enumerator NPY_OBJECT_
enumerator NPY_STRING_
enumerator NPY_UNICODE_
enumerator NPY_VOID_
enumerator NPY_INT8_
enumerator NPY_UINT8_
enumerator NPY_INT16_
enumerator NPY_UINT16_
enumerator NPY_INT32_
enumerator NPY_UINT32_
enumerator NPY_INT64_
enumerator NPY_UINT64_
enumerator NPY_ARRAY_C_CONTIGUOUS_
enumerator NPY_ARRAY_F_CONTIGUOUS_
enumerator NPY_ARRAY_OWNDATA_
enumerator NPY_ARRAY_FORCECAST_
enumerator NPY_ARRAY_ENSUREARRAY_
enumerator NPY_ARRAY_ALIGNED_
enumerator NPY_ARRAY_WRITEABLE_
enumerator NPY_BOOL_
enumerator NPY_BYTE_
enumerator NPY_UBYTE_
enumerator NPY_SHORT_
enumerator NPY_USHORT_
enumerator NPY_INT_
enumerator NPY_UINT_
enumerator NPY_LONG_
enumerator NPY_ULONG_
enumerator NPY_LONGLONG_
enumerator NPY_ULONGLONG_
enumerator NPY_FLOAT_
enumerator NPY_DOUBLE_
enumerator NPY_LONGDOUBLE_
enumerator NPY_CFLOAT_
enumerator NPY_CDOUBLE_
enumerator NPY_CLONGDOUBLE_
enumerator NPY_OBJECT_
enumerator NPY_STRING_
enumerator NPY_UNICODE_
enumerator NPY_VOID_
enumerator NPY_INT8_
enumerator NPY_UINT8_
enumerator NPY_INT16_
enumerator NPY_UINT16_
enumerator NPY_INT32_
enumerator NPY_UINT32_
enumerator NPY_INT64_
enumerator NPY_UINT64_

Public Functions

inline bool PyArray_Check_(PyObject *obj) const
inline bool PyArrayDescr_Check_(PyObject *obj) const
inline bool PyArray_Check_(PyObject *obj) const
inline bool PyArrayDescr_Check_(PyObject *obj) const

Public Members

unsigned int (*PyArray_GetNDArrayCFeatureVersion_)()
PyObject *(*PyArray_DescrFromType_)(int)
PyObject *(*PyArray_NewFromDescr_)(PyTypeObject*, PyObject*, int, Py_intptr_t*, Py_intptr_t*, void*, int, PyObject*)
PyObject *(*PyArray_DescrNewFromType_)(int)
int (*PyArray_CopyInto_)(PyObject*, PyObject*)
PyObject *(*PyArray_NewCopy_)(PyObject*, int)
PyTypeObject *PyArray_Type_
PyTypeObject *PyVoidArrType_Type_
PyTypeObject *PyArrayDescr_Type_
PyObject *(*PyArray_DescrFromScalar_)(PyObject*)
PyObject *(*PyArray_FromAny_)(PyObject*, PyObject*, int, int, int, PyObject*)
int (*PyArray_DescrConverter_)(PyObject*, PyObject**)
bool (*PyArray_EquivTypes_)(PyObject*, PyObject*)
int (*PyArray_GetArrayParamsFromObject_)(PyObject*, PyObject*, char, PyObject**, int*, Py_ssize_t*, PyObject**, PyObject*)
PyObject *(*PyArray_Squeeze_)(PyObject*)
int (*PyArray_SetBaseObject_)(PyObject*, PyObject*)
PyObject *(*PyArray_Resize_)(PyObject*, PyArray_Dims*, int, int)

Public Static Functions

static inline npy_api &get()
static inline npy_api &get()

Private Types

enum functions

Values:

enumerator API_PyArray_GetNDArrayCFeatureVersion
enumerator API_PyArray_Type
enumerator API_PyArrayDescr_Type
enumerator API_PyVoidArrType_Type
enumerator API_PyArray_DescrFromType
enumerator API_PyArray_DescrFromScalar
enumerator API_PyArray_FromAny
enumerator API_PyArray_Resize
enumerator API_PyArray_CopyInto
enumerator API_PyArray_NewCopy
enumerator API_PyArray_NewFromDescr
enumerator API_PyArray_DescrNewFromType
enumerator API_PyArray_DescrConverter
enumerator API_PyArray_EquivTypes
enumerator API_PyArray_GetArrayParamsFromObject
enumerator API_PyArray_Squeeze
enumerator API_PyArray_SetBaseObject
enumerator API_PyArray_GetNDArrayCFeatureVersion
enumerator API_PyArray_Type
enumerator API_PyArrayDescr_Type
enumerator API_PyVoidArrType_Type
enumerator API_PyArray_DescrFromType
enumerator API_PyArray_DescrFromScalar
enumerator API_PyArray_FromAny
enumerator API_PyArray_Resize
enumerator API_PyArray_CopyInto
enumerator API_PyArray_NewCopy
enumerator API_PyArray_NewFromDescr
enumerator API_PyArray_DescrNewFromType
enumerator API_PyArray_DescrConverter
enumerator API_PyArray_EquivTypes
enumerator API_PyArray_GetArrayParamsFromObject
enumerator API_PyArray_Squeeze
enumerator API_PyArray_SetBaseObject
enum functions

Values:

enumerator API_PyArray_GetNDArrayCFeatureVersion
enumerator API_PyArray_Type
enumerator API_PyArrayDescr_Type
enumerator API_PyVoidArrType_Type
enumerator API_PyArray_DescrFromType
enumerator API_PyArray_DescrFromScalar
enumerator API_PyArray_FromAny
enumerator API_PyArray_Resize
enumerator API_PyArray_CopyInto
enumerator API_PyArray_NewCopy
enumerator API_PyArray_NewFromDescr
enumerator API_PyArray_DescrNewFromType
enumerator API_PyArray_DescrConverter
enumerator API_PyArray_EquivTypes
enumerator API_PyArray_GetArrayParamsFromObject
enumerator API_PyArray_Squeeze
enumerator API_PyArray_SetBaseObject
enumerator API_PyArray_GetNDArrayCFeatureVersion
enumerator API_PyArray_Type
enumerator API_PyArrayDescr_Type
enumerator API_PyVoidArrType_Type
enumerator API_PyArray_DescrFromType
enumerator API_PyArray_DescrFromScalar
enumerator API_PyArray_FromAny
enumerator API_PyArray_Resize
enumerator API_PyArray_CopyInto
enumerator API_PyArray_NewCopy
enumerator API_PyArray_NewFromDescr
enumerator API_PyArray_DescrNewFromType
enumerator API_PyArray_DescrConverter
enumerator API_PyArray_EquivTypes
enumerator API_PyArray_GetArrayParamsFromObject
enumerator API_PyArray_Squeeze
enumerator API_PyArray_SetBaseObject

Private Static Functions

static inline npy_api lookup()
static inline npy_api lookup()
template<typename T, typename SFINAE>
struct npy_format_descriptor
#include <numpy.h>

Public Static Functions

static inline pybind11::dtype dtype()
static inline std::string format()
static inline void register_dtype(any_container<field_descriptor> fields)
static inline pybind11::dtype dtype()
static inline std::string format()
static inline void register_dtype(any_container<field_descriptor> fields)

Public Static Attributes

static constexpr auto name = make_caster<T>::name

Private Static Functions

static inline PyObject *dtype_ptr()
static inline bool direct_converter(PyObject *obj, void *&value)
static inline PyObject *dtype_ptr()
static inline bool direct_converter(PyObject *obj, void *&value)
template<size_t N>
struct npy_format_descriptor<char[N]>
#include <numpy.h>
template<size_t N>
struct npy_format_descriptor<std::array<char, N>>
#include <numpy.h>
template<typename T>
struct npy_format_descriptor<T, enable_if_t<array_info<T>::is_array>>
#include <numpy.h>

Public Static Functions

static inline pybind11::dtype dtype()
static inline pybind11::dtype dtype()

Public Static Attributes

static constexpr auto name = _("(") + array_info<T>::extents + _(")") + base_descr::name

Private Types

using base_descr = npy_format_descriptor<typename array_info<T>::type>
using base_descr = npy_format_descriptor<typename array_info<T>::type>
template<typename T>
struct npy_format_descriptor<T, enable_if_t<satisfies_any_of<T, std::is_arithmetic, is_complex>::value>> : public npy_format_descriptor_name<T>, public npy_format_descriptor_name<T>
#include <numpy.h>

Public Static Functions

static inline pybind11::dtype dtype()
static inline pybind11::dtype dtype()

Public Static Attributes

static constexpr int value = values[detail::is_fmt_numeric<T>::index]
template<typename T>
struct npy_format_descriptor<T, enable_if_t<std::is_enum<T>::value>>
#include <numpy.h>

Public Static Functions

static inline pybind11::dtype dtype()
static inline pybind11::dtype dtype()

Public Static Attributes

static constexpr auto name = base_descr::name

Private Types

using base_descr = npy_format_descriptor<typename std::underlying_type<T>::type>
using base_descr = npy_format_descriptor<typename std::underlying_type<T>::type>
template<typename T, typename = void>
struct npy_format_descriptor_name
#include <numpy.h>
template<typename T>
struct npy_format_descriptor_name<T, enable_if_t<is_complex<T>::value>>
#include <numpy.h>

Public Static Attributes

static constexpr auto name = _<std::is_same<typename T::value_type, float>::value || std::is_same<typename T::value_type, double>::value>(_("complex") + _<sizeof(typename T::value_type) * 16>(), _("longcomplex"))
template<typename T>
struct npy_format_descriptor_name<T, enable_if_t<std::is_floating_point<T>::value>>
#include <numpy.h>

Public Static Attributes

static constexpr auto name = _<std::is_same<T, float>::value || std::is_same<T, double>::value>(_("float") + _<sizeof(T) * 8>(), _("longdouble"))
template<typename T>
struct npy_format_descriptor_name<T, enable_if_t<std::is_integral<T>::value>>
#include <numpy.h>

Public Static Attributes

static constexpr auto name = _<std::is_same<T, bool>::value>(_("bool"), _<std::is_signed<T>::value>("int", "uint") + _<sizeof(T) * 8>())
template<typename T>
class NumericTest : public testing::Test
template<typename T>
class NumericTest : public testing::Test
struct numpy_internals
#include <numpy.h>

Public Functions

inline numpy_type_info *get_type_info(const std::type_info &tinfo, bool throw_if_missing = true)
template<typename T>
inline numpy_type_info *get_type_info(bool throw_if_missing = true)
inline numpy_type_info *get_type_info(const std::type_info &tinfo, bool throw_if_missing = true)
template<typename T>
inline numpy_type_info *get_type_info(bool throw_if_missing = true)

Public Members

std::unordered_map<std::type_index, numpy_type_info> registered_dtypes
struct numpy_type_info
#include <numpy.h>

Public Members

PyObject *dtype_ptr
std::string format_str
struct obj_attr
#include <pytypes.h>

Public Types

using key_type = object
using key_type = object

Public Static Functions

static inline object get(handle obj, handle key)
static inline void set(handle obj, handle key, handle val)
static inline object get(handle obj, handle key)
static inline void set(handle obj, handle key, handle val)
class object : public handle, public handle
#include <pytypes.h>

Holds a reference to a Python object (with reference counting)

Like handle, the object class is a thin wrapper around an arbitrary Python object (i.e. a PyObject * in Python’s C API). In contrast to handle, it optionally increases the object’s reference count upon construction, and it always* decreases the reference count when the object instance goes out of scope and is destructed. When using object instances consistently, it is much easier to get reference counting right at the first attempt.

Subclassed by bool_, bool_, buffer, buffer, bytes, bytes, capsule, capsule, dict, dict, dtype, dtype, exception< type >, exception< type >, float_, float_, function, function, generic_type, generic_type, int_, int_, iterable, iterable, iterator, iterator, list, list, memoryview, memoryview, module, module, none, none, sequence, sequence, set, set, slice, slice, staticmethod, staticmethod, str, str, tuple, tuple, weakref, weakref

Public Functions

object() = default
PYBIND11_DEPRECATED ("Use reinterpret_borrow<object>() or reinterpret_steal<object>()") object(handle h
inline object(const object &o)

Copy constructor; always increases the reference count.

inline object(object &&other) noexcept

Move constructor; steals the object from other and preserves its reference count.

inline ~object()

Destructor; automatically calls handle::dec_ref()

inline handle release()

Resets the internal pointer to nullptr without without decreasing the object’s reference count.

The function returns a raw handle to the original Python object.

inline object &operator=(const object &other)
inline object &operator=(object &&other) noexcept
template<typename T>
T cast() const &
template<typename T>
T cast() &&
inline object(handle h, borrowed_t)
inline object(handle h, stolen_t)
object() = default
PYBIND11_DEPRECATED ("Use reinterpret_borrow<object>() or reinterpret_steal<object>()") object(handle h
inline object(const object &o)

Copy constructor; always increases the reference count.

inline object(object &&other) noexcept

Move constructor; steals the object from other and preserves its reference count.

inline ~object()

Destructor; automatically calls handle::dec_ref()

inline handle release()

Resets the internal pointer to nullptr without without decreasing the object’s reference count.

The function returns a raw handle to the original Python object.

inline object &operator=(const object &other)
inline object &operator=(object &&other) noexcept
template<typename T>
T cast() const &
template<typename T>
T cast() &&
inline object(handle h, borrowed_t)
inline object(handle h, stolen_t)
template<typename T>
T cast() const &
template<typename T>
T cast() &&
template<>
inline void cast() const &
template<>
inline void cast() &&
template<typename T>
T cast() const &
template<typename T>
T cast() &&
template<>
inline void cast() const &
template<>
inline void cast() &&

Public Members

bool is_borrowed

Friends

template<typename T> friend friend T reinterpret_borrow (handle)

Declare that a handle or PyObject * is a certain type and borrow the reference.

The target type T must be object or one of its derived classes. The function doesn’t do any conversions or checks. It’s up to the user to make sure that the target type is correct.

.. code-block:: cpp

PyObject *p = PyList_GetItem(obj, index);
py::object o = reinterpret_borrow<py::object>(p);
or py::tuple t = reinterpret_borrow<py::tuple>(p); // < p must be already be a tuple

template<typename T> friend friend T reinterpret_steal (handle)

Like reinterpret_borrow, but steals the reference.

.. code-block:: cpp

PyObject *p = PyObject_Str(obj); py::str s = reinterpret_steal<py::str>(p); // < p must be already be a str

template<typename T> friend friend T reinterpret_borrow (handle)

Declare that a handle or PyObject * is a certain type and borrow the reference.

The target type T must be object or one of its derived classes. The function doesn’t do any conversions or checks. It’s up to the user to make sure that the target type is correct.

.. code-block:: cpp

PyObject *p = PyList_GetItem(obj, index);
py::object o = reinterpret_borrow<py::object>(p);
or py::tuple t = reinterpret_borrow<py::tuple>(p); // < p must be already be a tuple

template<typename T> friend friend T reinterpret_steal (handle)

Like reinterpret_borrow, but steals the reference.

.. code-block:: cpp

PyObject *p = PyObject_Str(obj); py::str s = reinterpret_steal<py::str>(p); // < p must be already be a str

template<typename Derived>
class object_api : public pyobject_tag, public pyobject_tag
#include <pytypes.h>

A mixin class which adds common functions to handle, object and various accessors.

The only requirement for Derived is to implement PyObject *Derived::ptr() const.

Public Functions

iterator begin() const

Return an iterator equivalent to calling iter() in Python.

The object must be a collection which supports the iteration protocol.

iterator end() const

Return a sentinel which ends iteration.

item_accessor operator[](handle key) const

Return an internal functor to invoke the object’s sequence protocol.

Casting the returned detail::item_accessor instance to a handle or object subclass causes a corresponding call to __getitem__. Assigning a handle or object subclass causes a call to __setitem__.

item_accessor operator[](const char *key) const

See above (the only difference is that they key is provided as a string literal)

obj_attr_accessor attr(handle key) const

Return an internal functor to access the object’s attributes.

Casting the returned detail::obj_attr_accessor instance to a handle or object subclass causes a corresponding call to getattr. Assigning a handle or object subclass causes a call to setattr.

str_attr_accessor attr(const char *key) const

See above (the only difference is that they key is provided as a string literal)

args_proxy operator*() const

Matches * unpacking in Python, e.g.

to unpack arguments out of a tuple or list for a function call. Applying another * to the result yields unpacking, e.g. to unpack a dict as function keyword arguments. See :ref:calling_python_functions.

template<typename T>
bool contains(T &&item) const

Check if the given item is contained within this object, i.e. item in obj.

template<return_value_policy policy = return_value_policy::automatic_reference, typename ...Args>
object operator()(Args&&... args) const

Assuming the Python object is a function or implements the __call__ protocol, operator() invokes the underlying function, passing an arbitrary set of parameters.

The result is returned as a object and may need to be converted back into a Python object using handle::cast().

When some of the arguments cannot be converted to Python objects, the function will throw a cast_error exception. When the Python function call fails, a error_already_set exception is thrown.

template<return_value_policy policy = return_value_policy::automatic_reference, typename... Args>  PYBIND11_DEPRECATED ("call(...) was deprecated in favor of operator()(...)") object call(Args &&... args) const
inline bool is(object_api const &other) const

Equivalent to obj is other in Python.

inline bool is_none() const

Equivalent to obj is None in Python.

inline bool equal(object_api const &other) const

Equivalent to obj == other in Python.

inline bool not_equal(object_api const &other) const
inline bool operator<(object_api const &other) const
inline bool operator<=(object_api const &other) const
inline bool operator>(object_api const &other) const
inline bool operator>=(object_api const &other) const
object operator-() const
object operator~() const
object operator+(object_api const &other) const
object operator+=(object_api const &other) const
object operator-(object_api const &other) const
object operator-=(object_api const &other) const
object operator*(object_api const &other) const
object operator*=(object_api const &other) const
object operator/(object_api const &other) const
object operator/=(object_api const &other) const
object operator|(object_api const &other) const
object operator|=(object_api const &other) const
object operator&(object_api const &other) const
object operator&=(object_api const &other) const
object operator^(object_api const &other) const
object operator^=(object_api const &other) const
object operator<<(object_api const &other) const
object operator<<=(object_api const &other) const
object operator>>(object_api const &other) const
object operator>>=(object_api const &other) const
pybind11::str str() const
str_attr_accessor doc() const

Get or set the object’s docstring, i.e. obj.__doc__.

inline int ref_count() const

Return the object’s current reference count.

handle get_type() const

Return a handle to the Python type object underlying the instance.

iterator begin() const

Return an iterator equivalent to calling iter() in Python.

The object must be a collection which supports the iteration protocol.

iterator end() const

Return a sentinel which ends iteration.

item_accessor operator[](handle key) const

Return an internal functor to invoke the object’s sequence protocol.

Casting the returned detail::item_accessor instance to a handle or object subclass causes a corresponding call to __getitem__. Assigning a handle or object subclass causes a call to __setitem__.

item_accessor operator[](const char *key) const

See above (the only difference is that they key is provided as a string literal)

obj_attr_accessor attr(handle key) const

Return an internal functor to access the object’s attributes.

Casting the returned detail::obj_attr_accessor instance to a handle or object subclass causes a corresponding call to getattr. Assigning a handle or object subclass causes a call to setattr.

str_attr_accessor attr(const char *key) const

See above (the only difference is that they key is provided as a string literal)

args_proxy operator*() const

Matches * unpacking in Python, e.g.

to unpack arguments out of a tuple or list for a function call. Applying another * to the result yields unpacking, e.g. to unpack a dict as function keyword arguments. See :ref:calling_python_functions.

template<typename T>
bool contains(T &&item) const

Check if the given item is contained within this object, i.e. item in obj.

template<return_value_policy policy = return_value_policy::automatic_reference, typename ...Args>
object operator()(Args&&... args) const

Assuming the Python object is a function or implements the __call__ protocol, operator() invokes the underlying function, passing an arbitrary set of parameters.

The result is returned as a object and may need to be converted back into a Python object using handle::cast().

When some of the arguments cannot be converted to Python objects, the function will throw a cast_error exception. When the Python function call fails, a error_already_set exception is thrown.

template<return_value_policy policy = return_value_policy::automatic_reference, typename... Args>  PYBIND11_DEPRECATED ("call(...) was deprecated in favor of operator()(...)") object call(Args &&... args) const
inline bool is(object_api const &other) const

Equivalent to obj is other in Python.

inline bool is_none() const

Equivalent to obj is None in Python.

inline bool equal(object_api const &other) const

Equivalent to obj == other in Python.

inline bool not_equal(object_api const &other) const
inline bool operator<(object_api const &other) const
inline bool operator<=(object_api const &other) const
inline bool operator>(object_api const &other) const
inline bool operator>=(object_api const &other) const
object operator-() const
object operator~() const
object operator+(object_api const &other) const
object operator+=(object_api const &other) const
object operator-(object_api const &other) const
object operator-=(object_api const &other) const
object operator*(object_api const &other) const
object operator*=(object_api const &other) const
object operator/(object_api const &other) const
object operator/=(object_api const &other) const
object operator|(object_api const &other) const
object operator|=(object_api const &other) const
object operator&(object_api const &other) const
object operator&=(object_api const &other) const
object operator^(object_api const &other) const
object operator^=(object_api const &other) const
object operator<<(object_api const &other) const
object operator<<=(object_api const &other) const
object operator>>(object_api const &other) const
object operator>>=(object_api const &other) const
pybind11::str str() const
str_attr_accessor doc() const

Get or set the object’s docstring, i.e. obj.__doc__.

inline int ref_count() const

Return the object’s current reference count.

handle get_type() const

Return a handle to the Python type object underlying the instance.

Private Functions

inline const Derived &derived() const
bool rich_compare(object_api const &other, int value) const
inline const Derived &derived() const
bool rich_compare(object_api const &other, int value) const
class OnTheFlyPrimeTable : public PrimeTable
#include <prime_tables.h>

Public Functions

inline virtual bool IsPrime(int n) const override
inline virtual int GetNextPrime(int p) const override
template<op_id id, op_type ot, typename L, typename R>
struct op_
#include <attr.h>

Operator implementation generator.

Public Functions

template<typename Class, typename ...Extra>
inline void execute(Class &cl, const Extra&... extra) const
template<typename Class, typename ...Extra>
inline void execute_cast(Class &cl, const Extra&... extra) const
template<typename Class, typename ...Extra>
inline void execute(Class &cl, const Extra&... extra) const
template<typename Class, typename ...Extra>
inline void execute_cast(Class &cl, const Extra&... extra) const
template<op_id, op_type, typename B, typename L, typename R>
struct op_impl
#include <operators.h>

base template of operator implementations

template<typename T>
struct optional_caster
#include <stl.h>

Public Types

using value_conv = make_caster<typename T::value_type>
using value_conv = make_caster<typename T::value_type>

Public Functions

inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (T, _("Optional[")+value_conv::name+_("]"))
inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (T, _("Optional[")+value_conv::name+_("]"))

Public Static Functions

template<typename T_>
static inline handle cast(T_ &&src, return_value_policy policy, handle parent)
template<typename T_>
static inline handle cast(T_ &&src, return_value_policy policy, handle parent)
class options
#include <options.h>

Public Functions

inline options()
options(const options&) = delete
options &operator=(const options&) = delete
inline ~options()
inline options &disable_user_defined_docstrings() &
inline options &enable_user_defined_docstrings() &
inline options &disable_function_signatures() &
inline options &enable_function_signatures() &
void *operator new(size_t) = delete
inline options()
options(const options&) = delete
options &operator=(const options&) = delete
inline ~options()
inline options &disable_user_defined_docstrings() &
inline options &enable_user_defined_docstrings() &
inline options &disable_function_signatures() &
inline options &enable_function_signatures() &
void *operator new(size_t) = delete

Public Static Functions

static inline bool show_user_defined_docstrings()
static inline bool show_function_signatures()
static inline bool show_user_defined_docstrings()
static inline bool show_function_signatures()

Private Members

state previous_state

Private Static Functions

static inline state &global_state()
static inline state &global_state()
class OstreamRedirect
#include <iostream.h>

Public Functions

inline OstreamRedirect(bool do_stdout = true, bool do_stderr = true)
inline void enter()
inline void exit()
inline OstreamRedirect(bool do_stdout = true, bool do_stderr = true)
inline void enter()
inline void exit()

Private Members

bool do_stdout_
bool do_stderr_
std::unique_ptr<scoped_ostream_redirect> redirect_stdout
std::unique_ptr<scoped_estream_redirect> redirect_stderr
template<typename ...Args>
struct overload_cast
#include <common.h>
template<typename ...Args>
struct overload_cast_impl
#include <common.h>

Public Functions

inline constexpr overload_cast_impl()
template<typename Return>
inline constexpr auto operator()(Return (*pf)(Args...)) const noexcept -> decltype(pf)
template<typename Return, typename Class>
inline constexpr auto operator()(Return (Class::* pmf)(Args...), std::false_type = {}, ) const noexcept -> decltype(pmf)
template<typename Return, typename Class>
inline constexpr auto operator()(Return (Class::* pmf)(Args...) const, std::true_type, ) const noexcept -> decltype(pmf)
inline constexpr overload_cast_impl()
template<typename Return>
inline constexpr auto operator()(Return (*pf)(Args...)) const noexcept -> decltype(pf)
template<typename Return, typename Class>
inline constexpr auto operator()(Return (Class::* pmf)(Args...), std::false_type = {}, ) const noexcept -> decltype(pmf)
template<typename Return, typename Class>
inline constexpr auto operator()(Return (Class::* pmf)(Args...) const, std::true_type, ) const noexcept -> decltype(pmf)
struct overload_hash
#include <internals.h>

Public Functions

inline size_t operator()(const std::pair<const PyObject*, const char*> &v) const
inline size_t operator()(const std::pair<const PyObject*, const char*> &v) const
struct overload_unused
#include <cast.h>
template<typename T>
class OverloadedMockMethodTest : public testing::Test
template<size_t N, typename T, typename ...Ts>
struct pack_element
#include <common.h>

Return the Nth element from the parameter pack.

Public Types

using type = typename pack_element<N - 1, Ts...>::type
using type = typename pack_element<N - 1, Ts...>::type
template<typename T, typename ...Ts>
struct pack_element<0, T, Ts...>
#include <common.h>

Public Types

using type = T
using type = T
class ParameterizedDeathTest : public testing::TestWithParam<int>
class ParameterizedDerivedTest : public NonParameterizedBaseTest, public testing::WithParamInterface<int>

Protected Functions

inline ParameterizedDerivedTest()

Protected Attributes

int count_

Protected Static Attributes

static int global_count_ = 0
class ParamTest : public testing::TestWithParam<int>, public testing::TestWithParam<std::string>
class ParentClass

Subclassed by ChildClassWithoutStreamOperator, ChildClassWithStreamOperator

class testing::ParseFlagsTest : public testing::Test

Protected Functions

inline virtual void SetUp() override

Protected Static Functions

template<typename CharType>
static inline void AssertStringArrayEq(int size1, CharType **array1, int size2, CharType **array2)
static inline void CheckFlags(const Flags &expected)
template<typename CharType>
static inline void TestParsingFlags(int argc1, const CharType **argv1, int argc2, const CharType **argv2, const Flags &expected, bool should_print_help)
class foo::PathLike

Public Types

using value_type = char
using const_iterator = iterator

Public Functions

inline PathLike()
inline iterator begin() const
inline iterator end() const

Friends

inline friend friend ::std::ostream & operator<< (::std::ostream &os, const PathLike &)
template<typename Get, typename Set, typename = function_signature_t<Get>, typename = function_signature_t<Set>>
struct pickle_factory
#include <init.h>

Implementation for py::pickle(GetState, SetState)

template<typename Get, typename Set, typename RetState, typename Self, typename NewInstance, typename ArgState>
struct pickle_factory<Get, Set, RetState(Self), NewInstance(ArgState)>
#include <init.h>

Public Functions

inline pickle_factory(Get get, Set set)
template<typename Class, typename ...Extra>
inline void execute(Class &cl, const Extra&... extra) &&
inline pickle_factory(Get get, Set set)
template<typename Class, typename ...Extra>
inline void execute(Class &cl, const Extra&... extra) &&

Public Members

remove_reference_t<Get> get
remove_reference_t<Set> set
class package_template::PID
#include <pid.hpp>

Simple 1D pid controller.

Public Functions

PID()

Construct a default PID object using the DefaultConfiguration.

PID(const Gains_configuration &configuration)

Construct a new PID object using a user provided configuration.

Parameters

configuration

~PID()
double compute(const double position, const double velocity, const double position_target, const double delta_time)

compute the force related to the pid controller.

Warning

this function is not stateless, as it performs integration. Call reset_pid() to reset the integral part.

Parameters
  • position – current position

  • velocity – current velocity

  • position_target – target position

  • delta_time – time passed since last measurement. Used for integral computation

Returns

computed force

void reset_integral()

reset integral part of the PID

Private Members

const Gains_configuration *configuration_
bool private_configuration_
double integral_
struct PointerPrintable
struct testing::internal::PointerPrinter
#include <gtest-printers.h>

Public Static Functions

template<typename T>
static inline void PrintValue(T *p, ::std::ostream *os)
template<typename T>
static inline void PrintValue(T *p, ::std::ostream *os)
template<typename itype, typename SFINAE = void>
struct polymorphic_type_hook
#include <cast.h>

Public Static Functions

static inline const void *get(const itype *src, const std::type_info*&)
static inline const void *get(const itype *src, const std::type_info*&)
template<typename itype>
struct polymorphic_type_hook<itype, detail::enable_if_t<std::is_polymorphic<itype>::value>>
#include <cast.h>

Public Static Functions

static inline const void *get(const itype *src, const std::type_info *&type)
static inline const void *get(const itype *src, const std::type_info *&type)
template<typename Impl>
class testing::PolymorphicAction
#include <gmock-actions.h>

Public Functions

inline explicit PolymorphicAction(const Impl &impl)
template<typename F>
inline operator Action<F>() const
inline explicit PolymorphicAction(const Impl &impl)
template<typename F>
inline operator Action<F>() const

Private Members

Impl impl_
class PreCalculatedPrimeTable : public PrimeTable
#include <prime_tables.h>

Public Functions

inline explicit PreCalculatedPrimeTable(int max)
inline ~PreCalculatedPrimeTable() override
inline virtual bool IsPrime(int n) const override
inline virtual int GetNextPrime(int p) const override

Private Functions

inline void CalculatePrimesUpTo(int max)
void operator=(const PreCalculatedPrimeTable &rhs)

Private Members

const int is_prime_size_
bool *const is_prime_
struct PredFormatFunctor1

Public Functions

template<typename T1>
inline testing::AssertionResult operator()(const char *e1, const T1 &v1) const
struct PredFormatFunctor2

Public Functions

template<typename T1, typename T2>
inline testing::AssertionResult operator()(const char *e1, const char *e2, const T1 &v1, const T2 &v2) const
struct PredFormatFunctor3

Public Functions

template<typename T1, typename T2, typename T3>
inline testing::AssertionResult operator()(const char *e1, const char *e2, const char *e3, const T1 &v1, const T2 &v2, const T3 &v3) const
struct PredFormatFunctor4

Public Functions

template<typename T1, typename T2, typename T3, typename T4>
inline testing::AssertionResult operator()(const char *e1, const char *e2, const char *e3, const char *e4, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4) const
struct PredFormatFunctor5

Public Functions

template<typename T1, typename T2, typename T3, typename T4, typename T5>
inline testing::AssertionResult operator()(const char *e1, const char *e2, const char *e3, const char *e4, const char *e5, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5) const
struct PredFunctor1

Public Functions

template<typename T1>
inline bool operator()(const T1 &v1)
struct PredFunctor2

Public Functions

template<typename T1, typename T2>
inline bool operator()(const T1 &v1, const T2 &v2)
struct PredFunctor3

Public Functions

template<typename T1, typename T2, typename T3>
inline bool operator()(const T1 &v1, const T2 &v2, const T3 &v3)
struct PredFunctor4

Public Functions

template<typename T1, typename T2, typename T3, typename T4>
inline bool operator()(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4)
struct PredFunctor5

Public Functions

template<typename T1, typename T2, typename T3, typename T4, typename T5>
inline bool operator()(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5)
class Predicate1Test : public testing::Test

Protected Functions

inline virtual void SetUp() override
inline virtual void TearDown() override

Protected Static Attributes

static bool expected_to_finish_
static bool finished_
static int n1_
class Predicate2Test : public testing::Test

Protected Functions

inline virtual void SetUp() override
inline virtual void TearDown() override

Protected Static Attributes

static bool expected_to_finish_
static bool finished_
static int n1_
static int n2_
class Predicate3Test : public testing::Test

Protected Functions

inline virtual void SetUp() override
inline virtual void TearDown() override

Protected Static Attributes

static bool expected_to_finish_
static bool finished_
static int n1_
static int n2_
static int n3_
class Predicate4Test : public testing::Test

Protected Functions

inline virtual void SetUp() override
inline virtual void TearDown() override

Protected Static Attributes

static bool expected_to_finish_
static bool finished_
static int n1_
static int n2_
static int n3_
static int n4_
class Predicate5Test : public testing::Test

Protected Functions

inline virtual void SetUp() override
inline virtual void TearDown() override

Protected Static Attributes

static bool expected_to_finish_
static bool finished_
static int n1_
static int n2_
static int n3_
static int n4_
static int n5_
class testing::internal::PrettyUnitTestResultPrinter : public testing::TestEventListener

Public Functions

inline PrettyUnitTestResultPrinter()
inline virtual void OnTestProgramStart(const UnitTest&) override
virtual void OnTestIterationStart(const UnitTest &unit_test, int iteration) override
virtual void OnEnvironmentsSetUpStart(const UnitTest &unit_test) override
inline virtual void OnEnvironmentsSetUpEnd(const UnitTest&) override
virtual void OnTestCaseStart(const TestCase &test_case) override
virtual void OnTestStart(const TestInfo &test_info) override
virtual void OnTestPartResult(const TestPartResult &result) override
virtual void OnTestEnd(const TestInfo &test_info) override
virtual void OnTestCaseEnd(const TestCase &test_case) override
virtual void OnEnvironmentsTearDownStart(const UnitTest &unit_test) override
inline virtual void OnEnvironmentsTearDownEnd(const UnitTest&) override
virtual void OnTestIterationEnd(const UnitTest &unit_test, int iteration) override
inline virtual void OnTestProgramEnd(const UnitTest&) override

Public Static Functions

static inline void PrintTestName(const char *test_suite, const char *test)

Private Static Functions

static void PrintFailedTests(const UnitTest &unit_test)
static void PrintFailedTestSuites(const UnitTest &unit_test)
static void PrintSkippedTests(const UnitTest &unit_test)
class PrimeTable
#include <prime_tables.h>

Subclassed by OnTheFlyPrimeTable, PreCalculatedPrimeTable

Public Functions

inline virtual ~PrimeTable()
virtual bool IsPrime(int n) const = 0
virtual int GetNextPrime(int p) const = 0
struct foo::PrintableViaPrintTo

Public Functions

inline PrintableViaPrintTo()

Public Members

int value
template<typename T>
class foo::PrintableViaPrintToTemplate

Public Functions

inline explicit PrintableViaPrintToTemplate(const T &a_value)
inline const T &value() const

Private Members

T value_
struct private_ctor
struct private_ctr_tag
class PrivateCode
#include <production.h>

Public Functions

FRIEND_TEST(PrivateCodeTest, CanAccessPrivateMembers)
FRIEND_TEST(PrivateCodeFixtureTest, CanAccessPrivateMembers)
PrivateCode()
inline int x() const

Private Functions

inline void set_x(int an_x)

Private Members

int x_
template<typename T, typename SFINAE = void>
struct process_attribute
#include <attr.h>

Partial template specializations to process custom attributes provided to cpp_function_ and class_.

These are either used to initialize the respective fields in the type_record and function_record data structures or executed at runtime to deal with custom call policies (e.g. keep_alive).

template<>
struct process_attribute<arg> : public process_attribute_default<arg>, public process_attribute_default<arg>
#include <attr.h>

Process a keyword argument attribute (without a default value)

Public Static Functions

static inline void init(const arg &a, function_record *r)
static inline void init(const arg &a, function_record *r)
template<>
struct process_attribute<arg_v> : public process_attribute_default<arg_v>, public process_attribute_default<arg_v>
#include <attr.h>

Process a keyword argument attribute (with a default value)

Public Static Functions

static inline void init(const arg_v &a, function_record *r)
static inline void init(const arg_v &a, function_record *r)
template<>
struct process_attribute<arithmetic> : public process_attribute_default<arithmetic>, public process_attribute_default<arithmetic>
#include <attr.h>

Process an ‘arithmetic’ attribute for enums (does nothing here)

template<typename T>
struct process_attribute<base<T>> : public process_attribute_default<base<T>>, public process_attribute_default<base<T>>
#include <attr.h>

Process a parent class attribute (deprecated, does not support multiple inheritance)

Public Static Functions

static inline void init(const base<T>&, type_record *r)
static inline void init(const base<T>&, type_record *r)
template<>
struct process_attribute<buffer_protocol> : public process_attribute_default<buffer_protocol>, public process_attribute_default<buffer_protocol>
#include <attr.h>

Public Static Functions

static inline void init(const buffer_protocol&, type_record *r)
static inline void init(const buffer_protocol&, type_record *r)
template<typename ...Ts>
struct process_attribute<call_guard<Ts...>> : public process_attribute_default<call_guard<Ts...>>, public process_attribute_default<call_guard<Ts...>>
#include <attr.h>
template<>
struct process_attribute<char*> : public process_attribute<const char*>, public process_attribute<const char*>
#include <attr.h>
template<>
struct process_attribute<const char*>
#include <attr.h>

Process an attribute specifying the function’s docstring (provided as a C-style string)

Public Static Functions

static inline void init(const char *d, function_record *r)
static inline void init(const char *d, type_record *r)
static inline void init(const char *d, function_record *r)
static inline void init(const char *d, type_record *r)
template<>
struct process_attribute<doc> : public process_attribute_default<doc>, public process_attribute_default<doc>
#include <attr.h>

Process an attribute specifying the function’s docstring.

Public Static Functions

static inline void init(const doc &n, function_record *r)
static inline void init(const doc &n, function_record *r)
template<>
struct process_attribute<dynamic_attr> : public process_attribute_default<dynamic_attr>, public process_attribute_default<dynamic_attr>
#include <attr.h>

Public Static Functions

static inline void init(const dynamic_attr&, type_record *r)
static inline void init(const dynamic_attr&, type_record *r)
template<>
struct process_attribute<is_method> : public process_attribute_default<is_method>, public process_attribute_default<is_method>
#include <attr.h>

Process an attribute which indicates that this function is a method.

Public Static Functions

static inline void init(const is_method &s, function_record *r)
static inline void init(const is_method &s, function_record *r)
template<>
struct process_attribute<is_new_style_constructor> : public process_attribute_default<is_new_style_constructor>, public process_attribute_default<is_new_style_constructor>
#include <attr.h>

Public Static Functions

static inline void init(const is_new_style_constructor&, function_record *r)
static inline void init(const is_new_style_constructor&, function_record *r)
template<>
struct process_attribute<is_operator> : public process_attribute_default<is_operator>, public process_attribute_default<is_operator>
#include <attr.h>

Process an attribute which indicates that this function is an operator.

Public Static Functions

static inline void init(const is_operator&, function_record *r)
static inline void init(const is_operator&, function_record *r)
template<size_t Nurse, size_t Patient>
struct process_attribute<keep_alive<Nurse, Patient>> : public process_attribute_default<keep_alive<Nurse, Patient>>, public process_attribute_default<keep_alive<Nurse, Patient>>
#include <attr.h>

Process a keep_alive call policy invokes keep_alive_impl during the pre-call handler if both Nurse, Patient != 0 and use the post-call handler otherwise.

Public Static Functions

template<size_t N = Nurse, size_t P = Patient, enable_if_t<N != 0 && P != 0, int> = 0>
static inline void precall(function_call &call)
template<size_t N = Nurse, size_t P = Patient, enable_if_t<N != 0 && P != 0, int> = 0>
static inline void postcall(function_call&, handle)
template<size_t N = Nurse, size_t P = Patient, enable_if_t<N == 0 || P == 0, int> = 0>
static inline void precall(function_call&)
template<size_t N = Nurse, size_t P = Patient, enable_if_t<N == 0 || P == 0, int> = 0>
static inline void postcall(function_call &call, handle ret)
template<size_t N = Nurse, size_t P = Patient, enable_if_t<N != 0 && P != 0, int> = 0>
static inline void precall(function_call &call)
template<size_t N = Nurse, size_t P = Patient, enable_if_t<N != 0 && P != 0, int> = 0>
static inline void postcall(function_call&, handle)
template<size_t N = Nurse, size_t P = Patient, enable_if_t<N == 0 || P == 0, int> = 0>
static inline void precall(function_call&)
template<size_t N = Nurse, size_t P = Patient, enable_if_t<N == 0 || P == 0, int> = 0>
static inline void postcall(function_call &call, handle ret)
template<>
struct process_attribute<metaclass> : public process_attribute_default<metaclass>, public process_attribute_default<metaclass>
#include <attr.h>

Public Static Functions

static inline void init(const metaclass &m, type_record *r)
static inline void init(const metaclass &m, type_record *r)
template<>
struct process_attribute<module_local> : public process_attribute_default<module_local>, public process_attribute_default<module_local>
#include <attr.h>

Public Static Functions

static inline void init(const module_local &l, type_record *r)
static inline void init(const module_local &l, type_record *r)
template<>
struct process_attribute<multiple_inheritance> : public process_attribute_default<multiple_inheritance>, public process_attribute_default<multiple_inheritance>
#include <attr.h>

Process a multiple inheritance attribute.

Public Static Functions

static inline void init(const multiple_inheritance&, type_record *r)
static inline void init(const multiple_inheritance&, type_record *r)
template<>
struct process_attribute<name> : public process_attribute_default<name>, public process_attribute_default<name>
#include <attr.h>

Process an attribute specifying the function’s name.

Public Static Functions

static inline void init(const name &n, function_record *r)
static inline void init(const name &n, function_record *r)
template<>
struct process_attribute<return_value_policy> : public process_attribute_default<return_value_policy>, public process_attribute_default<return_value_policy>
#include <attr.h>

Process an attribute indicating the function’s return value policy.

Public Static Functions

static inline void init(const return_value_policy &p, function_record *r)
static inline void init(const return_value_policy &p, function_record *r)
template<>
struct process_attribute<scope> : public process_attribute_default<scope>, public process_attribute_default<scope>
#include <attr.h>

Process an attribute which indicates the parent scope of a method.

Public Static Functions

static inline void init(const scope &s, function_record *r)
static inline void init(const scope &s, function_record *r)
template<>
struct process_attribute<sibling> : public process_attribute_default<sibling>, public process_attribute_default<sibling>
#include <attr.h>

Process an attribute which indicates that this is an overloaded function associated with a given sibling.

Public Static Functions

static inline void init(const sibling &s, function_record *r)
static inline void init(const sibling &s, function_record *r)
template<typename T>
struct process_attribute<T, enable_if_t<is_pyobject<T>::value>> : public process_attribute_default<handle>, public process_attribute_default<handle>
#include <attr.h>

Process a parent class attribute. Single inheritance only (class_ itself already guarantees that)

Public Static Functions

static inline void init(const handle &h, type_record *r)
static inline void init(const handle &h, type_record *r)
template<typename T>
struct process_attribute_default
#include <attr.h>

Public Static Functions

static inline void init(const T&, function_record*)

Default implementation: do nothing.

static inline void init(const T&, type_record*)
static inline void precall(function_call&)
static inline void postcall(function_call&, handle)
static inline void init(const T&, function_record*)

Default implementation: do nothing.

static inline void init(const T&, type_record*)
static inline void precall(function_call&)
static inline void postcall(function_call&, handle)
template<typename ...Args>
struct process_attributes
#include <attr.h>

Recursively iterate over variadic template arguments.

Public Static Functions

static inline void init(const Args&... args, function_record *r)
static inline void init(const Args&... args, type_record *r)
static inline void precall(function_call &call)
static inline void postcall(function_call &call, handle fn_ret)
static inline void init(const Args&... args, function_record *r)
static inline void init(const Args&... args, type_record *r)
static inline void precall(function_call &call)
static inline void postcall(function_call &call, handle fn_ret)
class PropertyOne : public testing::Test

Protected Functions

inline virtual void SetUp() override
inline virtual void TearDown() override
class PropertyRecordingTest : public Test

Public Static Functions

static inline void SetUpTestSuite()
static inline void TearDownTestSuite()
class PropertyTwo : public testing::Test

Protected Functions

inline virtual void SetUp() override
inline virtual void TearDown() override
class ProtectedFixtureMethodsTest : public testing::Test

Protected Functions

inline virtual void SetUp() override
inline virtual void TearDown() override
struct testing::internal::ProtobufPrinter
#include <gtest-printers.h>

Public Static Functions

template<typename T, typename = typename std::enable_if<internal::HasDebugStringAndShortDebugString<T>::value>::type>
static inline void PrintValue(const T &value, ::std::ostream *os)
template<typename T, typename = typename std::enable_if<internal::HasDebugStringAndShortDebugString<T>::value>::type>
static inline void PrintValue(const T &value, ::std::ostream *os)

Public Static Attributes

static const size_t kProtobufOneLinerMaxLength = 50
struct npy_api::PyArray_Dims
#include <numpy.h>

Public Members

Py_intptr_t *ptr
int len
struct PyArray_Proxy
#include <numpy.h>

Public Members

PyObject_HEAD char * data
int nd
ssize_t *dimensions
ssize_t *strides
PyObject *base
PyObject *descr
int flags
struct PyArrayDescr_Proxy
#include <numpy.h>

Public Members

PyObject_HEAD PyObject * typeobj
char kind
char type
char byteorder
char flags
int type_num
int elsize
int alignment
char *subarray
PyObject *fields
PyObject *names
template<typename type>
struct pyobject_caster
#include <cast.h>

Public Functions

template<typename T = type, enable_if_t<std::is_same<T, handle>::value, int> = 0>
inline bool load(handle src, bool)
template<typename T = type, enable_if_t<std::is_base_of<object, T>::value, int> = 0>
inline bool load(handle src, bool)
PYBIND11_TYPE_CASTER(type, handle_type_name<type>::name)
template<typename T = type, enable_if_t<std::is_same<T, handle>::value, int> = 0>
inline bool load(handle src, bool)
template<typename T = type, enable_if_t<std::is_base_of<object, T>::value, int> = 0>
inline bool load(handle src, bool)
PYBIND11_TYPE_CASTER(type, handle_type_name<type>::name)

Public Static Functions

static inline handle cast(const handle &src, return_value_policy, handle)
static inline handle cast(const handle &src, return_value_policy, handle)
template<typename T, int ExtraFlags>
struct pyobject_caster<array_t<T, ExtraFlags>>
#include <numpy.h>

Public Types

using type = array_t<T, ExtraFlags>
using type = array_t<T, ExtraFlags>

Public Functions

inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER(type, handle_type_name<type>::name)
inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER(type, handle_type_name<type>::name)

Public Static Functions

static inline handle cast(const handle &src, return_value_policy, handle)
static inline handle cast(const handle &src, return_value_policy, handle)
class pyobject_tag
#include <pytypes.h>

Tag and check to identify a class which implements the Python object API.

Subclassed by object_api< Derived >, object_api< Derived >, object_api< accessor< Policy > >, object_api< accessor< Policy > >

class pythonbuf : public streambuf, public streambuf
#include <iostream.h>

Public Functions

inline pythonbuf(object pyostream, size_t buffer_size = 1024)
pythonbuf(pythonbuf&&) = default
inline ~pythonbuf()

Sync before destroy.

inline pythonbuf(object pyostream, size_t buffer_size = 1024)
pythonbuf(pythonbuf&&) = default
inline ~pythonbuf()

Sync before destroy.

Private Types

using traits_type = std::streambuf::traits_type
using traits_type = std::streambuf::traits_type

Private Functions

inline int overflow(int c)
inline int sync()
inline int overflow(int c)
inline int sync()

Private Members

const size_t buf_size
std::unique_ptr<char[]> d_buffer
object pywrite
object pyflush
struct PyVoidScalarObject_Proxy
#include <numpy.h>

Public Members

PyObject_VAR_HEAD char * obval
PyArrayDescr_Proxy *descr
int flags
PyObject *base
template<typename E>
class Queue
#include <sample3-inl.h>

Public Functions

inline Queue()
inline ~Queue()
inline void Clear()
inline size_t Size() const
inline QueueNode<E> *Head()
inline const QueueNode<E> *Head() const
inline QueueNode<E> *Last()
inline const QueueNode<E> *Last() const
inline void Enqueue(const E &element)
inline E *Dequeue()
template<typename F>
inline Queue *Map(F function) const

Private Functions

Queue(const Queue&)
const Queue &operator=(const Queue&)

Private Members

QueueNode<E> *head_
QueueNode<E> *last_
size_t size_
template<typename E>
class QueueNode
#include <sample3-inl.h>

Public Functions

inline const E &element() const
inline QueueNode *next()
inline const QueueNode *next() const

Private Functions

inline explicit QueueNode(const E &an_element)
const QueueNode &operator=(const QueueNode&)
QueueNode(const QueueNode&)

Private Members

E element_
QueueNode *next_

Friends

friend class Queue< E >
struct testing::internal::RawBytesPrinter
#include <gtest-printers.h>

Public Static Functions

template<typename T, size_t = sizeof(T)>
static inline void PrintValue(const T &value, ::std::ostream *os)
template<typename T, size_t = sizeof(T)>
static inline void PrintValue(const T &value, ::std::ostream *os)
template<typename T>
struct remove_class
#include <common.h>

Strip the class from a method type.

template<typename C, typename R, typename ...A>
struct remove_class<R (C::*)(A...) const>
#include <common.h>

Public Types

typedef R type(A...)
typedef R type(A...)
template<typename C, typename R, typename ...A>
struct remove_class<R (C::*)(A...)>
#include <common.h>

Public Types

typedef R type(A...)
typedef R type(A...)
template<typename Return, typename SFINAE = void>
struct return_value_policy_override
#include <cast.h>

Public Static Functions

static inline return_value_policy policy(return_value_policy p)
static inline return_value_policy policy(return_value_policy p)
template<typename Return>
struct return_value_policy_override<Return, detail::enable_if_t<std::is_base_of<type_caster_generic, make_caster<Return>>::value, void>>
#include <cast.h>

Public Static Functions

static inline return_value_policy policy(return_value_policy p)
static inline return_value_policy policy(return_value_policy p)
template<typename R>
class testing::internal::ReturnAction
#include <gmock-actions.h>

Public Functions

inline explicit ReturnAction(R value)
template<typename F>
inline operator Action<F>() const
inline explicit ReturnAction(R value)
template<typename F>
inline operator Action<F>() const

Private Members

const std::shared_ptr<R> value_
template<size_t k>
struct testing::internal::ReturnArgAction
#include <gmock-actions.h>

Public Functions

template<typename ...Args>
inline auto operator()(const Args&... args) const -> typename std::tuple_element<k, std::tuple<Args...>>::type
template<typename ...Args>
inline auto operator()(const Args&... args) const -> typename std::tuple_element<k, std::tuple<Args...>>::type
template<typename T, typename ...Params>
struct testing::internal::ReturnNewAction
#include <gmock-actions.h>

Public Functions

inline T *operator()() const
inline T *operator()() const

Public Members

std::tuple<Params...> params
class testing::internal::ReturnNullAction
#include <gmock-actions.h>

Public Static Functions

template<typename Result, typename ArgumentTuple>
static inline Result Perform(const ArgumentTuple&)
template<typename Result, typename ArgumentTuple>
static inline Result Perform(const ArgumentTuple&)
template<typename Ptr>
struct testing::internal::ReturnPointeeAction
#include <gmock-actions.h>

Public Functions

template<typename ...Args>
inline auto operator()(const Args&...) const -> decltype(*pointer)
template<typename ...Args>
inline auto operator()(const Args&...) const -> decltype(*pointer)

Public Members

Ptr pointer
template<typename T>
class testing::internal::ReturnRefAction
#include <gmock-actions.h>

Public Functions

inline explicit ReturnRefAction(T &ref)
template<typename F>
inline operator Action<F>() const
inline explicit ReturnRefAction(T &ref)
template<typename F>
inline operator Action<F>() const

Private Members

T &ref_
template<typename T>
class testing::internal::ReturnRefOfCopyAction
#include <gmock-actions.h>

Public Functions

inline explicit ReturnRefOfCopyAction(const T &value)
template<typename F>
inline operator Action<F>() const
inline explicit ReturnRefOfCopyAction(const T &value)
template<typename F>
inline operator Action<F>() const

Private Members

const T value_
template<typename T>
class testing::internal::ReturnRoundRobinAction
#include <gmock-actions.h>

Public Functions

inline explicit ReturnRoundRobinAction(std::vector<T> values)
template<typename ...Args>
inline T operator()(Args&&...) const
inline explicit ReturnRoundRobinAction(std::vector<T> values)
template<typename ...Args>
inline T operator()(Args&&...) const

Private Members

std::shared_ptr<State> state_ = std::make_shared<State>()
class testing::internal::ReturnVoidAction
#include <gmock-actions.h>

Public Static Functions

template<typename Result, typename ArgumentTuple>
static inline void Perform(const ArgumentTuple&)
template<typename Result, typename ArgumentTuple>
static inline void Perform(const ArgumentTuple&)
class package_template::RosParameters_configuration : public package_template::Gains_configuration
#include <rosparameters_configuration.hpp>

Read gains configuration from the ros parameter server.

Public Functions

RosParameters_configuration()

Attempt to get the gains from the parameter server (“gains_kp”,”gains_kd”,”gains_ki” parameters) If roscore is running, calls to this constructor will be blocking until all the gains are read or roscore is turned off.

If roscore is turned off before gains are read, has_error() will return true

See

has_error()

virtual double get_kp() const

Get the proportinal gain.

virtual double get_kd() const

Get the derivative gain.

virtual double get_ki() const

get the integral gain

virtual bool has_error() const

Check if there are internal errors

virtual std::string get_error() const

Get the error messages

Private Members

double kp_

Proportinal gain.

double kd_

Derivative gain.

double ki_

Integral gain.

std::string error_message_

Internal error message.

bool error_

True is an error occured.

template<typename T>
struct same_size
#include <numpy.h>

Public Types

using as = bool_constant<sizeof(T) == sizeof(U)>
using as = bool_constant<sizeof(T) == sizeof(U)>
template<size_t k, typename Ptr>
struct testing::internal::SaveArgAction
#include <gmock-actions.h>

Public Functions

template<typename ...Args>
inline void operator()(const Args&... args) const
template<typename ...Args>
inline void operator()(const Args&... args) const

Public Members

Ptr pointer
template<size_t k, typename Ptr>
struct testing::internal::SaveArgPointeeAction
#include <gmock-actions.h>

Public Functions

template<typename ...Args>
inline void operator()(const Args&... args) const
template<typename ...Args>
inline void operator()(const Args&... args) const

Public Members

Ptr pointer
struct scope
#include <attr.h>

Annotation for parent scope.

Public Functions

inline scope(const handle &s)
inline scope(const handle &s)

Public Members

handle value
class scoped_estream_redirect : public scoped_ostream_redirect, public scoped_ostream_redirect
#include <iostream.h>

Like scoped_ostream_redirect, but redirects cerr by default.

This class is provided primary to make py::call_guard easier to make.

.. code-block:: cpp

m.def(“noisy_func”, &noisy_func, py::call_guard<scoped_ostream_redirect, scoped_estream_redirect>());

Public Functions

inline scoped_estream_redirect(std::ostream &costream = std::cerr, object pyostream = module::import("sys").attr("stderr"))
inline scoped_estream_redirect(std::ostream &costream = std::cerr, object pyostream = module::import("sys").attr("stderr"))
class scoped_interpreter
#include <embed.h>

Scope guard version of initialize_interpreter and finalize_interpreter.

This a move-only guard and only a single instance can exist.

.. code-block:: cpp

#include <pybind11/embed.h>

int main() {
    py::scoped_interpreter guard{};
    py::print(Hello, World!);
} // <-- interpreter shutdown

Public Functions

inline scoped_interpreter(bool init_signal_handlers = true)
scoped_interpreter(const scoped_interpreter&) = delete
inline scoped_interpreter(scoped_interpreter &&other) noexcept
scoped_interpreter &operator=(const scoped_interpreter&) = delete
scoped_interpreter &operator=(scoped_interpreter&&) = delete
inline ~scoped_interpreter()
inline scoped_interpreter(bool init_signal_handlers = true)
scoped_interpreter(const scoped_interpreter&) = delete
inline scoped_interpreter(scoped_interpreter &&other) noexcept
scoped_interpreter &operator=(const scoped_interpreter&) = delete
scoped_interpreter &operator=(scoped_interpreter&&) = delete
inline ~scoped_interpreter()

Private Members

bool is_valid = true
class scoped_ostream_redirect
#include <iostream.h>

This a move-only guard that redirects output.

.. code-block:: cpp

#include <pybind11/iostream.h>

...

{
    py::scoped_ostream_redirect output;
    std::cout << "Hello, World!"; // Python stdout
} // <-- return std::cout to normal

You can explicitly pass the c++ stream and the python object, for example to guard stderr instead.

.. code-block:: cpp

{
    py::scoped_ostream_redirect output{std::cerr, py::module::import("sys").attr("stderr")};
    std::cerr << "Hello, World!";
}

Subclassed by scoped_estream_redirect, scoped_estream_redirect

Public Functions

inline scoped_ostream_redirect(std::ostream &costream = std::cout, object pyostream = module::import("sys").attr("stdout"))
inline ~scoped_ostream_redirect()
scoped_ostream_redirect(const scoped_ostream_redirect&) = delete
scoped_ostream_redirect(scoped_ostream_redirect &&other) = default
scoped_ostream_redirect &operator=(const scoped_ostream_redirect&) = delete
scoped_ostream_redirect &operator=(scoped_ostream_redirect&&) = delete
inline scoped_ostream_redirect(std::ostream &costream = std::cout, object pyostream = module::import("sys").attr("stdout"))
inline ~scoped_ostream_redirect()
scoped_ostream_redirect(const scoped_ostream_redirect&) = delete
scoped_ostream_redirect(scoped_ostream_redirect &&other) = default
scoped_ostream_redirect &operator=(const scoped_ostream_redirect&) = delete
scoped_ostream_redirect &operator=(scoped_ostream_redirect&&) = delete

Protected Attributes

std::streambuf *old
std::ostream &costream
detail::pythonbuf buffer
class testing::internal::ScopedPrematureExitFile

Public Functions

inline explicit ScopedPrematureExitFile(const char *premature_exit_filepath)
inline ~ScopedPrematureExitFile()

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedPrematureExitFile)

Private Members

const std::string premature_exit_filepath_
class testing::ScopedTrace
#include <gtest.h>

Public Functions

template<typename T>
inline ScopedTrace(const char *file, int line, const T &message)
inline ScopedTrace(const char *file, int line, const char *message)
inline ScopedTrace(const char *file, int line, const std::string &message)
~ScopedTrace()
template<typename T>
inline ScopedTrace(const char *file, int line, const T &message)
inline ScopedTrace(const char *file, int line, const char *message)
inline ScopedTrace(const char *file, int line, const std::string &message)
~ScopedTrace()

Private Functions

void PushTrace(const char *file, int line, std::string message)
GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace)
void PushTrace(const char *file, int line, std::string message)
GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace)
template<typename ISeq, size_t, bool...>
struct select_indices_impl
#include <common.h>

Make an index sequence of the indices of true arguments.

Public Types

using type = ISeq
using type = ISeq
template<size_t... IPrev, size_t I, bool B, bool... Bs>
struct select_indices_impl<index_sequence<IPrev...>, I, B, Bs...> : public select_indices_impl<conditional_t<B, index_sequence<IPrev..., I>, index_sequence<IPrev...>>, I + 1, Bs...>, public select_indices_impl<conditional_t<B, index_sequence<IPrev..., I>, index_sequence<IPrev...>>, I + 1, Bs...>
#include <common.h>
struct self_t
#include <operators.h>
class SeparateInstanceTest : public testing::TestWithParam<int>

Public Functions

inline SeparateInstanceTest()

Public Static Functions

static inline void TearDownTestSuite()

Protected Attributes

int count_

Protected Static Attributes

static int global_count_ = 0
class sequence : public object, public object
#include <pytypes.h>

Public Functions

inline size_t size() const
inline bool empty() const
inline detail::sequence_accessor operator[](size_t index) const
inline detail::item_accessor operator[](handle h) const
inline detail::sequence_iterator begin() const
inline detail::sequence_iterator end() const
inline size_t size() const
inline bool empty() const
inline detail::sequence_accessor operator[](size_t index) const
inline detail::item_accessor operator[](handle h) const
inline detail::sequence_iterator begin() const
inline detail::sequence_iterator end() const
class sequence_fast_readonly
#include <pytypes.h>

Lightweight iterator policy using just a simple pointer: see PySequence_Fast_ITEMS

Protected Types

using iterator_category = std::random_access_iterator_tag
using value_type = handle
using reference = const handle
using pointer = arrow_proxy<const handle>
using iterator_category = std::random_access_iterator_tag
using value_type = handle
using reference = const handle
using pointer = arrow_proxy<const handle>

Protected Functions

inline sequence_fast_readonly(handle obj, ssize_t n)
inline reference dereference() const
inline void increment()
inline void decrement()
inline void advance(ssize_t n)
inline bool equal(const sequence_fast_readonly &b) const
inline ssize_t distance_to(const sequence_fast_readonly &b) const
inline sequence_fast_readonly(handle obj, ssize_t n)
inline reference dereference() const
inline void increment()
inline void decrement()
inline void advance(ssize_t n)
inline bool equal(const sequence_fast_readonly &b) const
inline ssize_t distance_to(const sequence_fast_readonly &b) const

Private Members

PyObject **ptr
struct sequence_item
#include <pytypes.h>

Public Types

using key_type = size_t
using key_type = size_t

Public Static Functions

static inline object get(handle obj, size_t index)
static inline void set(handle obj, size_t index, handle val)
static inline object get(handle obj, size_t index)
static inline void set(handle obj, size_t index, handle val)
class sequence_slow_readwrite
#include <pytypes.h>

Full read and write access using the sequence protocol: see detail::sequence_accessor

Protected Types

using iterator_category = std::random_access_iterator_tag
using value_type = object
using reference = sequence_accessor
using pointer = arrow_proxy<const sequence_accessor>
using iterator_category = std::random_access_iterator_tag
using value_type = object
using reference = sequence_accessor
using pointer = arrow_proxy<const sequence_accessor>

Protected Functions

inline sequence_slow_readwrite(handle obj, ssize_t index)
inline reference dereference() const
inline void increment()
inline void decrement()
inline void advance(ssize_t n)
inline bool equal(const sequence_slow_readwrite &b) const
inline ssize_t distance_to(const sequence_slow_readwrite &b) const
inline sequence_slow_readwrite(handle obj, ssize_t index)
inline reference dereference() const
inline void increment()
inline void decrement()
inline void advance(ssize_t n)
inline bool equal(const sequence_slow_readwrite &b) const
inline ssize_t distance_to(const sequence_slow_readwrite &b) const

Private Members

handle obj
ssize_t index
class SequenceTestingListener : public testing::EmptyTestEventListener

Public Functions

inline SequenceTestingListener(std::vector<std::string> *vector, const char *id)

Protected Functions

inline virtual void OnTestProgramStart(const UnitTest&) override
inline virtual void OnTestProgramEnd(const UnitTest&) override
inline virtual void OnTestIterationStart(const UnitTest&, int) override
inline virtual void OnTestIterationEnd(const UnitTest&, int) override

Private Functions

inline std::string GetEventDescription(const char *method)
GTEST_DISALLOW_COPY_AND_ASSIGN_(SequenceTestingListener)

Private Members

std::vector<std::string> *vector_
const char *const id_
class set : public object, public object
#include <pytypes.h>

Public Functions

inline set()
inline size_t size() const
inline bool empty() const
template<typename T>
inline bool add(T &&val) const
inline void clear() const
template<typename T>
inline bool contains(T &&val) const
inline set()
inline size_t size() const
inline bool empty() const
template<typename T>
inline bool add(T &&val) const
inline void clear() const
template<typename T>
inline bool contains(T &&val) const
template<typename Type, typename Key>
struct set_caster
#include <stl.h>

Public Types

using type = Type
using key_conv = make_caster<Key>
using type = Type
using key_conv = make_caster<Key>

Public Functions

inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (type, _("Set[")+key_conv::name+_("]"))
inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (type, _("Set[")+key_conv::name+_("]"))

Public Static Functions

template<typename T>
static inline handle cast(T &&src, return_value_policy policy, handle parent)
template<typename T>
static inline handle cast(T &&src, return_value_policy policy, handle parent)
template<size_t k, typename T>
struct testing::internal::SetArgRefereeAction
#include <gmock-actions.h>

Public Functions

template<typename ...Args>
inline void operator()(Args&&... args) const
template<typename ...Args>
inline void operator()(Args&&... args) const

Public Members

T value
template<size_t N, typename A, typename = void>
struct testing::internal::SetArgumentPointeeAction
#include <gmock-actions.h>

Public Functions

template<typename ...Args>
inline void operator()(const Args&... args) const
template<typename ...Args>
inline void operator()(const Args&... args) const

Public Members

A value
template<size_t k, typename I1, typename I2>
struct testing::internal::SetArrayArgumentAction
#include <gmock-actions.h>

Public Functions

template<typename ...Args>
inline void operator()(const Args&... args) const
template<typename ...Args>
inline void operator()(const Args&... args) const

Public Members

I1 first
I2 last
template<typename T>
class testing::internal::SetErrnoAndReturnAction
#include <gmock-actions.h>

Public Functions

inline SetErrnoAndReturnAction(int errno_value, T result)
template<typename Result, typename ArgumentTuple>
inline Result Perform(const ArgumentTuple&) const
inline SetErrnoAndReturnAction(int errno_value, T result)
template<typename Result, typename ArgumentTuple>
inline Result Perform(const ArgumentTuple&) const

Private Members

const int errno_
const T result_
struct Setup_should_be_spelled_SetUp
struct Setup_should_be_spelled_SetUp
class SetupEnvironment : public testing::Environment

Public Functions

inline virtual void SetUp() override
class SetupFailTest : public testing::Test

Protected Static Functions

static inline void SetUpTestSuite()
class testing::SetUpTestCaseTest : public testing::Test

Protected Functions

inline virtual void SetUp() override

Protected Static Functions

static inline void SetUpTestCase()
static inline void TearDownTestCase()

Protected Static Attributes

static int counter_ = 0
static const char *shared_resource_ = nullptr
class testing::SetUpTestSuiteTest : public testing::Test

Protected Functions

inline virtual void SetUp() override

Protected Static Functions

static inline void SetUpTestSuite()
static inline void TearDownTestSuite()

Protected Static Attributes

static int counter_ = 0
static const char *shared_resource_ = nullptr
struct sibling
#include <attr.h>

Annotation indicating that a function is an overload associated with a given “sibling”.

Public Functions

inline sibling(const handle &value)
inline sibling(const handle &value)

Public Members

handle value
template<return_value_policy policy>
class simple_collector
#include <cast.h>

Helper class which collects only positional arguments for a Python function call.

A fancier version below can collect any argument, but this one is optimal for simple calls.

Public Functions

template<typename ...Ts>
inline explicit simple_collector(Ts&&... values)
inline const tuple &args() const &
inline dict kwargs() const
inline tuple args() &&
inline object call(PyObject *ptr) const

Call a Python function and pass the collected arguments.

template<typename ...Ts>
inline explicit simple_collector(Ts&&... values)
inline const tuple &args() const &
inline dict kwargs() const
inline tuple args() &&
inline object call(PyObject *ptr) const

Call a Python function and pass the collected arguments.

Private Members

tuple m_args
class SkippedTest : public Test
class slice : public object, public object
#include <pytypes.h>

Public Functions

inline slice(ssize_t start_, ssize_t stop_, ssize_t step_)
inline bool compute(size_t length, size_t *start, size_t *stop, size_t *step, size_t *slicelength) const
inline bool compute(ssize_t length, ssize_t *start, ssize_t *stop, ssize_t *step, ssize_t *slicelength) const
inline slice(ssize_t start_, ssize_t stop_, ssize_t step_)
inline bool compute(size_t length, size_t *start, size_t *stop, size_t *step, size_t *slicelength) const
inline bool compute(ssize_t length, ssize_t *start, ssize_t *stop, ssize_t *step, ssize_t *slicelength) const
template<typename T>
class testing::gmock_function_mocker_test::StackInterface

Subclassed by testing::gmock_function_mocker_test::LegacyMockStack< T >, testing::gmock_function_mocker_test::MockStack< T >

Public Functions

inline virtual ~StackInterface()
virtual void Push(const T &value) = 0
virtual void Pop() = 0
virtual int GetSize() const = 0
virtual const T &GetTop() const = 0
struct testing::internal::ReturnRoundRobinAction::State

Public Functions

inline T Next()
inline T Next()

Public Members

std::vector<T> values
size_t i = 0
struct options::state

Public Members

bool show_user_defined_docstrings = true
bool show_function_signatures = true
struct StatefulNamingFunctor

Public Functions

inline StatefulNamingFunctor()
inline std::string operator()(const ::testing::TestParamInfo<int> &info)

Public Members

int sum
class StatefulNamingTest : public testing::TestWithParam<int>

Protected Functions

inline StatefulNamingTest()

Protected Attributes

int sum_
template<typename T>
class StaticAssertTypeEqTestHelper

Public Functions

inline StaticAssertTypeEqTestHelper()
class staticmethod : public object, public object
#include <pytypes.h>
struct stolen_t
#include <pytypes.h>
class str : public object, public object
#include <pytypes.h>

Public Functions

inline str(const char *c, size_t n)
inline str(const char *c = "")
inline str(const std::string &s)
inline explicit str(const bytes &b)
inline explicit str(handle h)

Return a string representation of the object.

This is analogous to the str() function in Python.

inline operator std::string() const
template<typename ...Args>
inline str format(Args&&... args) const
inline str(const char *c, size_t n)
inline str(const char *c = "")
inline str(const std::string &s)
explicit str(const bytes &b)
inline explicit str(handle h)

Return a string representation of the object.

This is analogous to the str() function in Python.

inline operator std::string() const
template<typename ...Args>
inline str format(Args&&... args) const

Private Static Functions

static inline PyObject *raw_str(PyObject *op)

Return string representation always returns a new reference, even if already a str.

static inline PyObject *raw_str(PyObject *op)

Return string representation always returns a new reference, even if already a str.

struct str_attr
#include <pytypes.h>

Public Types

using key_type = const char*
using key_type = const char*

Public Static Functions

static inline object get(handle obj, const char *key)
static inline void set(handle obj, const char *key, handle val)
static inline object get(handle obj, const char *key)
static inline void set(handle obj, const char *key, handle val)
class StreamableInGlobal

Public Functions

inline virtual ~StreamableInGlobal()
template<typename T>
class foo::StreamableTemplateInFoo

Public Functions

inline StreamableTemplateInFoo()
inline const T &value() const

Private Members

T value_
struct testing::internal::internal_stream_operator_without_lexical_name_lookup::StreamPrinter
#include <gtest-printers.h>

Public Static Functions

template<typename T, typename = typename std::enable_if<!std::is_member_pointer<T>::value>::type, typename = decltype(std::declval<std::ostream&>() << std::declval<const T&>())>
static inline void PrintValue(const T &value, ::std::ostream *os)
template<typename T, typename = typename std::enable_if<!std::is_member_pointer<T>::value>::type, typename = decltype(std::declval<std::ostream&>() << std::declval<const T&>())>
static inline void PrintValue(const T &value, ::std::ostream *os)
template<class MockClass>
class testing::StrictMock : private testing::internal::StrictMockImpl<MockClass>, public MockClass, private testing::internal::StrictMockImpl<MockClass>, public MockClass
#include <gmock-nice-strict.h>

Public Functions

inline StrictMock()
template<typename A>
inline explicit StrictMock(A &&arg)
template<typename TArg1, typename TArg2, typename ...An>
inline StrictMock(TArg1 &&arg1, TArg2 &&arg2, An&&... args)
inline StrictMock()
template<typename A>
inline explicit StrictMock(A &&arg)
template<typename TArg1, typename TArg2, typename ...An>
inline StrictMock(TArg1 &&arg1, TArg2 &&arg2, An&&... args)

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(StrictMock)
GTEST_DISALLOW_COPY_AND_ASSIGN_(StrictMock)
template<typename Base>
class testing::internal::StrictMockImpl
#include <gmock-nice-strict.h>

Public Functions

inline StrictMockImpl()
inline ~StrictMockImpl()
inline StrictMockImpl()
inline ~StrictMockImpl()
template<typename StringType, bool IsView = false>
struct string_caster
#include <cast.h>

Public Types

using CharT = typename StringType::value_type
using CharT = typename StringType::value_type

Public Functions

inline bool load(handle src, bool)
PYBIND11_TYPE_CASTER(StringType, _(PYBIND11_STRING_NAME))
inline bool load(handle src, bool)
PYBIND11_TYPE_CASTER(StringType, _(PYBIND11_STRING_NAME))

Public Static Functions

static inline handle cast(const StringType &src, return_value_policy, handle)
static inline handle cast(const StringType &src, return_value_policy, handle)

Public Static Attributes

static constexpr size_t UTF_N = 8 * sizeof(CharT)

Private Functions

template<typename C = CharT>
inline bool load_bytes(enable_if_t<std::is_same<C, char>::value, handle> src)
template<typename C = CharT>
inline bool load_bytes(enable_if_t<!std::is_same<C, char>::value, handle>)
template<typename C = CharT>
inline bool load_bytes(enable_if_t<std::is_same<C, char>::value, handle> src)
template<typename C = CharT>
inline bool load_bytes(enable_if_t<!std::is_same<C, char>::value, handle>)

Private Static Functions

static inline handle decode_utfN(const char *buffer, ssize_t nbytes)
static inline handle decode_utfN(const char *buffer, ssize_t nbytes)
template<typename F>
struct strip_function_object
#include <common.h>

Public Types

using type = typename remove_class<decltype(&F::operator())>::type
using type = typename remove_class<decltype(&F::operator())>::type
class SuccessfulTest : public Test
struct testing::gmock_more_actions_test::SumOf5Functor

Public Functions

inline int operator()(int a, int b, int c, int d, int e)
struct testing::gmock_more_actions_test::SumOf6Functor

Public Functions

inline int operator()(int a, int b, int c, int d, int e, int f)
class TearDownFailTest : public testing::Test

Protected Static Functions

static inline void TearDownTestSuite()
template<typename T>
class testing::gmock_function_mocker_test::TemplatedCopyable

Public Functions

inline TemplatedCopyable()
template<typename U>
inline TemplatedCopyable(const U &other)
struct TemplatedStreamableInFoo
template<typename T>
class TemplateMockTest : public testing::Test
class testing::gmock_more_actions_test::TenArgConstructorClass

Public Functions

inline TenArgConstructorClass(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10)

Public Members

int value_
class Test
class testing::Test
#include <gtest.h>

Subclassed by bar::MixedUpTestSuiteTest, bar::MixedUpTestSuiteWithSameTestNameTest, CommonTest< T >, ContainerTest< T >, DetectNotInstantiatedTypesTest< T >, DynamicFixture, DynamicUnitTestFixture, ExpectFailureTest, FatalFailureInFixtureConstructorTest, FatalFailureInSetUpTest, foo::MixedUpTestSuiteTest, foo::MixedUpTestSuiteWithSameTestNameTest, FooTest, FooTest, FooTestFixture, GMockOutputTest, library1::NumericTest< T >, library2::NumericTest< T >, library2::TrimmedTest< T >, MacroNamingTestNonParametrized, NonFatalFailureInFixtureConstructorTest, NonFatalFailureInSetUpTest, NonParameterizedBaseTest, Predicate1Test, Predicate2Test, Predicate3Test, Predicate4Test, Predicate5Test, PropertyOne, PropertyTwo, ProtectedFixtureMethodsTest, SetupFailTest, TearDownFailTest, TEST_before_TEST_F_in_same_test_case, TEST_F_before_TEST_in_same_test_case, testing::CodeLocationForTESTF, testing::CodeLocationForTYPEDTEST< T >, testing::CodeLocationForTYPEDTESTP< T >, testing::CurrentTestInfoTest, testing::gmock_function_mocker_test::ExpectCallTest< T >, testing::gmock_function_mocker_test::FunctionMockerTest< T >, testing::gmock_function_mocker_test::MockMethodMockFunctionSignatureTest< F >, testing::gmock_function_mocker_test::OverloadedMockMethodTest< T >, testing::gmock_function_mocker_test::TemplateMockTest< T >, testing::internal::ListenerTest, testing::internal::TestSuiteWithCommentTest< T >, testing::internal::UnitTestRecordPropertyTestHelper, testing::ParseFlagsTest, testing::SetUpTestCaseTest, testing::SetUpTestSuiteTest, testing::TestInfoTest, testing::TestWithParam< T >, testing::TestWithParam< T >, testing::TestWithParam< int >, testing::TestWithParam< int >, testing::TestWithParam< MyEnums >, testing::TestWithParam< MyEnums >, testing::TestWithParam< MyType >, testing::TestWithParam< MyType >, testing::TestWithParam< std::string >, testing::TestWithParam< std::string >, TypedTest< T >, TypedTest< T >, TypedTest< T >, TypedTest1< T >, TypedTest2< T >, TypedTestP< T >, TypedTestP1< T >, TypedTestP2< T >, TypedTestSuitePStateTest, TypedTestWithNames< T >, TypedTestWithNames< T >, TypeParameterizedTestSuite< T >, TypeParametrizedTestWithNames< T >, TypeParamTest< T >, works_here::NotInstantiatedTypeTest< T >, works_here::NotUsedTypeTest< T >

Public Functions

virtual ~Test()
virtual ~Test()

Public Static Functions

static inline void SetUpTestSuite()
static inline void TearDownTestSuite()
static inline void TearDownTestCase()
static inline void SetUpTestCase()
static bool HasFatalFailure()
static bool HasNonfatalFailure()
static bool IsSkipped()
static inline bool HasFailure()
static void RecordProperty(const std::string &key, const std::string &value)
static void RecordProperty(const std::string &key, int value)
static inline void SetUpTestSuite()
static inline void TearDownTestSuite()
static inline void TearDownTestCase()
static inline void SetUpTestCase()
static bool HasFatalFailure()
static bool HasNonfatalFailure()
static bool IsSkipped()
static inline bool HasFailure()
static void RecordProperty(const std::string &key, const std::string &value)
static void RecordProperty(const std::string &key, int value)

Protected Functions

Test()
virtual void SetUp()
virtual void TearDown()
Test()
virtual void SetUp()
virtual void TearDown()

Private Functions

virtual void TestBody() = 0
void Run()
inline void DeleteSelf_()
inline virtual Setup_should_be_spelled_SetUp *Setup()
GTEST_DISALLOW_COPY_AND_ASSIGN_(Test)
virtual void TestBody() = 0
void Run()
inline void DeleteSelf_()
inline virtual Setup_should_be_spelled_SetUp *Setup()
GTEST_DISALLOW_COPY_AND_ASSIGN_(Test)

Private Members

const std::unique_ptr<GTEST_FLAG_SAVER_> gtest_flag_saver_

Private Static Functions

static bool HasSameFixtureClass()
static bool HasSameFixtureClass()

Friends

friend class TestInfo
template<class ...Args>
struct testing::internal::gmockpp::Test

Public Static Attributes

static constexpr int kArgs = sizeof...(Args)
class TEST_before_TEST_F_in_same_test_case : public testing::Test
class TEST_F_before_TEST_in_same_test_case : public testing::Test
class testing::TestEventListener
#include <gtest.h>

Subclassed by testing::EmptyTestEventListener, testing::EmptyTestEventListener, testing::internal::BriefUnitTestResultPrinter, testing::internal::EventRecordingListener, testing::internal::EventRecordingListener2, testing::internal::PrettyUnitTestResultPrinter, testing::internal::TestEventRepeater

Public Functions

inline virtual ~TestEventListener()
virtual void OnTestProgramStart(const UnitTest &unit_test) = 0
virtual void OnTestIterationStart(const UnitTest &unit_test, int iteration) = 0
virtual void OnEnvironmentsSetUpStart(const UnitTest &unit_test) = 0
virtual void OnEnvironmentsSetUpEnd(const UnitTest &unit_test) = 0
inline virtual void OnTestSuiteStart(const TestSuite&)
inline virtual void OnTestCaseStart(const TestCase&)
virtual void OnTestStart(const TestInfo &test_info) = 0
virtual void OnTestPartResult(const TestPartResult &test_part_result) = 0
virtual void OnTestEnd(const TestInfo &test_info) = 0
inline virtual void OnTestSuiteEnd(const TestSuite&)
inline virtual void OnTestCaseEnd(const TestCase&)
virtual void OnEnvironmentsTearDownStart(const UnitTest &unit_test) = 0
virtual void OnEnvironmentsTearDownEnd(const UnitTest &unit_test) = 0
virtual void OnTestIterationEnd(const UnitTest &unit_test, int iteration) = 0
virtual void OnTestProgramEnd(const UnitTest &unit_test) = 0
inline virtual ~TestEventListener()
virtual void OnTestProgramStart(const UnitTest &unit_test) = 0
virtual void OnTestIterationStart(const UnitTest &unit_test, int iteration) = 0
virtual void OnEnvironmentsSetUpStart(const UnitTest &unit_test) = 0
virtual void OnEnvironmentsSetUpEnd(const UnitTest &unit_test) = 0
inline virtual void OnTestSuiteStart(const TestSuite&)
inline virtual void OnTestCaseStart(const TestCase&)
virtual void OnTestStart(const TestInfo &test_info) = 0
virtual void OnTestPartResult(const TestPartResult &test_part_result) = 0
virtual void OnTestEnd(const TestInfo &test_info) = 0
inline virtual void OnTestSuiteEnd(const TestSuite&)
inline virtual void OnTestCaseEnd(const TestCase&)
virtual void OnEnvironmentsTearDownStart(const UnitTest &unit_test) = 0
virtual void OnEnvironmentsTearDownEnd(const UnitTest &unit_test) = 0
virtual void OnTestIterationEnd(const UnitTest &unit_test, int iteration) = 0
virtual void OnTestProgramEnd(const UnitTest &unit_test) = 0
class testing::TestEventListeners
#include <gtest.h>

Public Functions

TestEventListeners()
~TestEventListeners()
void Append(TestEventListener *listener)
TestEventListener *Release(TestEventListener *listener)
inline TestEventListener *default_result_printer() const
inline TestEventListener *default_xml_generator() const
TestEventListeners()
~TestEventListeners()
void Append(TestEventListener *listener)
TestEventListener *Release(TestEventListener *listener)
inline TestEventListener *default_result_printer() const
inline TestEventListener *default_xml_generator() const

Private Functions

TestEventListener *repeater()
void SetDefaultResultPrinter(TestEventListener *listener)
void SetDefaultXmlGenerator(TestEventListener *listener)
bool EventForwardingEnabled() const
void SuppressEventForwarding()
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners)
TestEventListener *repeater()
void SetDefaultResultPrinter(TestEventListener *listener)
void SetDefaultXmlGenerator(TestEventListener *listener)
bool EventForwardingEnabled() const
void SuppressEventForwarding()
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners)

Private Members

internal::TestEventRepeater *repeater_
TestEventListener *default_result_printer_
TestEventListener *default_xml_generator_

Friends

friend class TestSuite
friend class TestInfo
friend class internal::DefaultGlobalTestPartResultReporter
friend class internal::NoExecDeathTest
friend class internal::TestEventListenersAccessor
friend class internal::UnitTestImpl
class testing::internal::TestEventListenersAccessor

Public Static Functions

static inline TestEventListener *GetRepeater(TestEventListeners *listeners)
static inline void SetDefaultResultPrinter(TestEventListeners *listeners, TestEventListener *listener)
static inline void SetDefaultXmlGenerator(TestEventListeners *listeners, TestEventListener *listener)
static inline bool EventForwardingEnabled(const TestEventListeners &listeners)
static inline void SuppressEventForwarding(TestEventListeners *listeners)
class testing::internal::TestEventRepeater : public testing::TestEventListener

Public Functions

inline TestEventRepeater()
~TestEventRepeater() override
void Append(TestEventListener *listener)
TestEventListener *Release(TestEventListener *listener)
inline bool forwarding_enabled() const
inline void set_forwarding_enabled(bool enable)
virtual void OnTestProgramStart(const UnitTest &unit_test) override
virtual void OnTestIterationStart(const UnitTest &unit_test, int iteration) override
virtual void OnEnvironmentsSetUpStart(const UnitTest &unit_test) override
virtual void OnEnvironmentsSetUpEnd(const UnitTest &unit_test) override
void OnTestCaseStart(const TestSuite &parameter) override
virtual void OnTestSuiteStart(const TestSuite &parameter) override
virtual void OnTestStart(const TestInfo &test_info) override
virtual void OnTestPartResult(const TestPartResult &result) override
virtual void OnTestEnd(const TestInfo &test_info) override
virtual void OnTestCaseEnd(const TestCase &parameter) override
virtual void OnTestSuiteEnd(const TestSuite &parameter) override
virtual void OnEnvironmentsTearDownStart(const UnitTest &unit_test) override
virtual void OnEnvironmentsTearDownEnd(const UnitTest &unit_test) override
virtual void OnTestIterationEnd(const UnitTest &unit_test, int iteration) override
virtual void OnTestProgramEnd(const UnitTest &unit_test) override

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventRepeater)

Private Members

bool forwarding_enabled_
std::vector<TestEventListener*> listeners_
template<int kExpectedCalls>
class TestGenerationEnvironment : public testing::Environment

Public Functions

inline void FixtureConstructorExecuted()
inline void SetUpExecuted()
inline void TearDownExecuted()
inline void TestBodyExecuted()
inline virtual void TearDown() override

Public Static Functions

static inline TestGenerationEnvironment *Instance()

Private Functions

inline TestGenerationEnvironment()
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestGenerationEnvironment)

Private Members

int fixture_constructor_count_
int set_up_count_
int tear_down_count_
int test_body_count_
class TestGenerationTest : public testing::TestWithParam<int>

Public Types

enum [anonymous]

Values:

enumerator PARAMETER_COUNT
typedef TestGenerationEnvironment<PARAMETER_COUNT> Environment

Public Functions

inline TestGenerationTest()
inline virtual void SetUp() override
inline virtual void TearDown() override

Public Static Functions

static inline void SetUpTestSuite()
static inline void TearDownTestSuite()

Protected Attributes

int current_parameter_

Protected Static Attributes

static vector<int> collected_parameters_

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(TestGenerationTest)
class testing::TestInfo
#include <gtest.h>

Public Functions

~TestInfo()
inline const char *test_suite_name() const
inline const char *test_case_name() const
inline const char *name() const
inline const char *type_param() const
inline const char *value_param() const
inline const char *file() const
inline int line() const
inline bool is_in_another_shard() const
inline bool should_run() const
inline bool is_reportable() const
inline const TestResult *result() const
~TestInfo()
inline const char *test_suite_name() const
inline const char *test_case_name() const
inline const char *name() const
inline const char *type_param() const
inline const char *value_param() const
inline const char *file() const
inline int line() const
inline bool is_in_another_shard() const
inline bool should_run() const
inline bool is_reportable() const
inline const TestResult *result() const

Private Functions

TestInfo(const std::string &test_suite_name, const std::string &name, const char *a_type_param, const char *a_value_param, internal::CodeLocation a_code_location, internal::TypeId fixture_class_id, internal::TestFactoryBase *factory)
inline int increment_death_test_count()
void Run()
void Skip()
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo)
TestInfo(const std::string &test_suite_name, const std::string &name, const char *a_type_param, const char *a_value_param, internal::CodeLocation a_code_location, internal::TypeId fixture_class_id, internal::TestFactoryBase *factory)
inline int increment_death_test_count()
void Run()
void Skip()
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo)

Private Members

const std::string test_suite_name_
const std::string name_
const std::unique_ptr<const ::std::string> type_param_
const std::unique_ptr<const ::std::string> value_param_
internal::CodeLocation location_
const internal::TypeId fixture_class_id_
bool should_run_
bool is_disabled_
bool matches_filter_
bool is_in_another_shard_
internal::TestFactoryBase *const factory_
TestResult result_

Private Static Functions

static inline void ClearTestResult(TestInfo *test_info)
static inline void ClearTestResult(TestInfo *test_info)

Friends

friend class Test
friend class TestSuite
friend class internal::UnitTestImpl
friend class internal::StreamingListenerTest
friend friend TestInfo * internal::MakeAndRegisterTestInfo (const char *test_suite_name, const char *name, const char *type_param, const char *value_param, internal::CodeLocation code_location, internal::TypeId fixture_class_id, internal::SetUpTestSuiteFunc set_up_tc, internal::TearDownTestSuiteFunc tear_down_tc, internal::TestFactoryBase *factory)
friend friend TestInfo * internal::MakeAndRegisterTestInfo (const char *test_suite_name, const char *name, const char *type_param, const char *value_param, internal::CodeLocation code_location, internal::TypeId fixture_class_id, internal::SetUpTestSuiteFunc set_up_tc, internal::TearDownTestSuiteFunc tear_down_tc, internal::TestFactoryBase *factory)
class testing::TestInfoTest : public testing::Test

Protected Static Functions

static inline const TestInfo *GetTestInfo(const char *test_name)
static inline const TestResult *GetTestResult(const TestInfo *test_info)
class TestingVector : public std::vector<int>
class TestListener : public testing::EmptyTestEventListener

Public Functions

inline TestListener()
inline TestListener(int *on_start_counter, bool *is_destroyed)
inline ~TestListener() override

Protected Functions

inline virtual void OnTestProgramStart(const UnitTest&) override

Private Members

int *on_start_counter_
bool *is_destroyed_
class testing::TestProperty
#include <gtest.h>

Public Functions

inline TestProperty(const std::string &a_key, const std::string &a_value)
inline const char *key() const
inline const char *value() const
inline void SetValue(const std::string &new_value)
inline TestProperty(const std::string &a_key, const std::string &a_value)
inline const char *key() const
inline const char *value() const
inline void SetValue(const std::string &new_value)

Private Members

std::string key_
std::string value_
class testing::TestResult
#include <gtest.h>

Public Functions

TestResult()
~TestResult()
int total_part_count() const
int test_property_count() const
inline bool Passed() const
bool Skipped() const
bool Failed() const
bool HasFatalFailure() const
bool HasNonfatalFailure() const
inline TimeInMillis elapsed_time() const
inline TimeInMillis start_timestamp() const
const TestPartResult &GetTestPartResult(int i) const
const TestProperty &GetTestProperty(int i) const
TestResult()
~TestResult()
int total_part_count() const
int test_property_count() const
inline bool Passed() const
bool Skipped() const
bool Failed() const
bool HasFatalFailure() const
bool HasNonfatalFailure() const
inline TimeInMillis elapsed_time() const
inline TimeInMillis start_timestamp() const
const TestPartResult &GetTestPartResult(int i) const
const TestProperty &GetTestProperty(int i) const

Private Functions

inline const std::vector<TestPartResult> &test_part_results() const
inline const std::vector<TestProperty> &test_properties() const
inline void set_start_timestamp(TimeInMillis start)
inline void set_elapsed_time(TimeInMillis elapsed)
void RecordProperty(const std::string &xml_element, const TestProperty &test_property)
void AddTestPartResult(const TestPartResult &test_part_result)
inline int death_test_count() const
inline int increment_death_test_count()
void ClearTestPartResults()
void Clear()
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult)
inline const std::vector<TestPartResult> &test_part_results() const
inline const std::vector<TestProperty> &test_properties() const
inline void set_start_timestamp(TimeInMillis start)
inline void set_elapsed_time(TimeInMillis elapsed)
void RecordProperty(const std::string &xml_element, const TestProperty &test_property)
void AddTestPartResult(const TestPartResult &test_part_result)
inline int death_test_count() const
inline int increment_death_test_count()
void ClearTestPartResults()
void Clear()
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult)

Private Members

internal::Mutex test_properties_mutex_
std::vector<TestPartResult> test_part_results_
std::vector<TestProperty> test_properties_
int death_test_count_
TimeInMillis start_timestamp_
TimeInMillis elapsed_time_

Private Static Functions

static bool ValidateTestProperty(const std::string &xml_element, const TestProperty &test_property)
static bool ValidateTestProperty(const std::string &xml_element, const TestProperty &test_property)

Friends

friend class TestInfo
friend class TestSuite
friend class UnitTest
friend class internal::DefaultGlobalTestPartResultReporter
friend class internal::ExecDeathTest
friend class internal::TestResultAccessor
friend class internal::UnitTestImpl
friend class internal::WindowsDeathTest
friend class internal::FuchsiaDeathTest
class testing::TestSuite
#include <gtest.h>

Public Functions

TestSuite(const char *name, const char *a_type_param, internal::SetUpTestSuiteFunc set_up_tc, internal::TearDownTestSuiteFunc tear_down_tc)
virtual ~TestSuite()
inline const char *name() const
inline const char *type_param() const
inline bool should_run() const
int successful_test_count() const
int skipped_test_count() const
int failed_test_count() const
int reportable_disabled_test_count() const
int disabled_test_count() const
int reportable_test_count() const
int test_to_run_count() const
int total_test_count() const
inline bool Passed() const
inline bool Failed() const
inline TimeInMillis elapsed_time() const
inline TimeInMillis start_timestamp() const
const TestInfo *GetTestInfo(int i) const
inline const TestResult &ad_hoc_test_result() const
TestSuite(const char *name, const char *a_type_param, internal::SetUpTestSuiteFunc set_up_tc, internal::TearDownTestSuiteFunc tear_down_tc)
virtual ~TestSuite()
inline const char *name() const
inline const char *type_param() const
inline bool should_run() const
int successful_test_count() const
int skipped_test_count() const
int failed_test_count() const
int reportable_disabled_test_count() const
int disabled_test_count() const
int reportable_test_count() const
int test_to_run_count() const
int total_test_count() const
inline bool Passed() const
inline bool Failed() const
inline TimeInMillis elapsed_time() const
inline TimeInMillis start_timestamp() const
const TestInfo *GetTestInfo(int i) const
inline const TestResult &ad_hoc_test_result() const

Private Functions

inline std::vector<TestInfo*> &test_info_list()
inline const std::vector<TestInfo*> &test_info_list() const
TestInfo *GetMutableTestInfo(int i)
inline void set_should_run(bool should)
void AddTestInfo(TestInfo *test_info)
void ClearResult()
void Run()
void Skip()
inline void RunSetUpTestSuite()
inline void RunTearDownTestSuite()
void ShuffleTests(internal::Random *random)
void UnshuffleTests()
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestSuite)
inline std::vector<TestInfo*> &test_info_list()
inline const std::vector<TestInfo*> &test_info_list() const
TestInfo *GetMutableTestInfo(int i)
inline void set_should_run(bool should)
void AddTestInfo(TestInfo *test_info)
void ClearResult()
void Run()
void Skip()
inline void RunSetUpTestSuite()
inline void RunTearDownTestSuite()
void ShuffleTests(internal::Random *random)
void UnshuffleTests()
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestSuite)

Private Members

std::string name_
const std::unique_ptr<const ::std::string> type_param_
std::vector<TestInfo*> test_info_list_
std::vector<int> test_indices_
internal::SetUpTestSuiteFunc set_up_tc_
internal::TearDownTestSuiteFunc tear_down_tc_
bool should_run_
TimeInMillis start_timestamp_
TimeInMillis elapsed_time_
TestResult ad_hoc_test_result_

Private Static Functions

static inline void ClearTestSuiteResult(TestSuite *test_suite)
static inline bool TestPassed(const TestInfo *test_info)
static inline bool TestSkipped(const TestInfo *test_info)
static inline bool TestFailed(const TestInfo *test_info)
static inline bool TestReportableDisabled(const TestInfo *test_info)
static inline bool TestDisabled(const TestInfo *test_info)
static inline bool TestReportable(const TestInfo *test_info)
static inline bool ShouldRunTest(const TestInfo *test_info)
static inline void ClearTestSuiteResult(TestSuite *test_suite)
static inline bool TestPassed(const TestInfo *test_info)
static inline bool TestSkipped(const TestInfo *test_info)
static inline bool TestFailed(const TestInfo *test_info)
static inline bool TestReportableDisabled(const TestInfo *test_info)
static inline bool TestDisabled(const TestInfo *test_info)
static inline bool TestReportable(const TestInfo *test_info)
static inline bool ShouldRunTest(const TestInfo *test_info)

Friends

friend class Test
friend class internal::UnitTestImpl
class testing::internal::TestSuiteNameIs

Public Functions

inline explicit TestSuiteNameIs(const std::string &name)
inline bool operator()(const TestSuite *test_suite) const

Private Members

std::string name_
template<typename T>
class TestSuiteWithCommentTest : public testing::Test
template<typename T>
class TestWithParam : public testing::Test, public testing::WithParamInterface<T>, public testing::Test, public testing::WithParamInterface<T>
#include <gtest.h>
template<typename Pattern>
struct testing::internal::ThisRefAdjuster
#include <gmock-function-mocker.h>

Public Types

using AdjustT = typename std::conditional<std::is_const<typename std::remove_reference<Pattern>::type>::value, typename std::conditional<std::is_lvalue_reference<Pattern>::value, const T&, const T&&>::type, typename std::conditional<std::is_lvalue_reference<Pattern>::value, T&, T&&>::type>::type
using AdjustT = typename std::conditional<std::is_const<typename std::remove_reference<Pattern>::type>::value, typename std::conditional<std::is_lvalue_reference<Pattern>::value, const T&, const T&&>::type, typename std::conditional<std::is_lvalue_reference<Pattern>::value, T&, T&&>::type>::type

Public Static Functions

template<typename MockType>
static inline AdjustT<MockType> Adjust(const MockType &mock)
template<typename MockType>
static inline AdjustT<MockType> Adjust(const MockType &mock)
class ThrowListener : public testing::EmptyTestEventListener

Private Functions

inline void OnTestPartResult(const testing::TestPartResult &result) override
class testing::internal::Timer

Public Functions

inline Timer()
inline TimeInMillis Elapsed()

Private Members

std::chrono::steady_clock::time_point start_
class testing::internal::To

Public Functions

inline To(bool *converted)
template<typename T>
class TrimmedTest : public testing::Test
class tuple : public object, public object
#include <pytypes.h>

Subclassed by args, args

Public Functions

inline explicit tuple(size_t size = 0)
inline size_t size() const
inline bool empty() const
inline detail::tuple_accessor operator[](size_t index) const
inline detail::item_accessor operator[](handle h) const
inline detail::tuple_iterator begin() const
inline detail::tuple_iterator end() const
inline explicit tuple(size_t size = 0)
inline size_t size() const
inline bool empty() const
inline detail::tuple_accessor operator[](size_t index) const
inline detail::item_accessor operator[](handle h) const
inline detail::tuple_iterator begin() const
inline detail::tuple_iterator end() const
template<template<typename...> class Tuple, typename ...Ts>
class tuple_caster
#include <cast.h>

Public Types

using cast_op_type = type
using cast_op_type = type

Public Functions

inline bool load(handle src, bool convert)
inline operator type() &
inline operator type() &&
inline bool load(handle src, bool convert)
inline operator type() &
inline operator type() &&

Public Static Functions

template<typename T>
static inline handle cast(T &&src, return_value_policy policy, handle parent)
template<typename T>
static inline handle cast(T &&src, return_value_policy policy, handle parent)

Public Static Attributes

static constexpr auto name = _("Tuple[") + concat(make_caster<Ts>::name...) + _("]")

Protected Functions

template<size_t... Is>
inline type implicit_cast(index_sequence<Is...>) &
template<size_t... Is>
inline type implicit_cast(index_sequence<Is...>) &&
template<size_t... Is>
inline bool load_impl(const sequence &seq, bool convert, index_sequence<Is...>)
template<size_t... Is>
inline type implicit_cast(index_sequence<Is...>) &
template<size_t... Is>
inline type implicit_cast(index_sequence<Is...>) &&
template<size_t... Is>
inline bool load_impl(const sequence &seq, bool convert, index_sequence<Is...>)

Protected Attributes

Tuple<make_caster<Ts>...> subcasters

Protected Static Functions

static inline constexpr bool load_impl(const sequence&, bool, index_sequence<>)
template<typename T, size_t... Is>
static inline handle cast_impl(T &&src, return_value_policy policy, handle parent, index_sequence<Is...>)
static inline constexpr bool load_impl(const sequence&, bool, index_sequence<>)
template<typename T, size_t... Is>
static inline handle cast_impl(T &&src, return_value_policy policy, handle parent, index_sequence<Is...>)

Private Types

using type = Tuple<Ts...>
using indices = make_index_sequence<size>
using type = Tuple<Ts...>
using indices = make_index_sequence<size>

Private Static Attributes

static constexpr auto size = sizeof...(Ts)
struct tuple_item
#include <pytypes.h>

Public Types

using key_type = size_t
using key_type = size_t

Public Static Functions

static inline object get(handle obj, size_t index)
static inline void set(handle obj, size_t index, handle val)
static inline object get(handle obj, size_t index)
static inline void set(handle obj, size_t index, handle val)
template<>
struct call_guard<T, Ts...>::type
#include <attr.h>

Public Members

T guard = {}
call_guard<Ts...>::type next = {}
template<typename type, typename SFINAE = void>
class type_caster : public type_caster_base<type>, public type_caster_base<type>
#include <cast.h>
template<>
class type_caster<bool>
#include <cast.h>

Public Functions

inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (bool, _("bool"))
inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (bool, _("bool"))

Public Static Functions

static inline handle cast(bool src, return_value_policy, handle)
static inline handle cast(bool src, return_value_policy, handle)
template<typename CharT>
struct type_caster<CharT, enable_if_t<is_std_char_type<CharT>::value>>
#include <cast.h>

Public Types

using StringType = std::basic_string<CharT>
using StringCaster = type_caster<StringType>
using cast_op_type = pybind11::detail::cast_op_type<_T>
using StringType = std::basic_string<CharT>
using StringCaster = type_caster<StringType>
using cast_op_type = pybind11::detail::cast_op_type<_T>

Public Functions

inline bool load(handle src, bool convert)
inline operator CharT*()
inline operator CharT&()
inline bool load(handle src, bool convert)
inline operator CharT*()
inline operator CharT&()

Public Members

StringCaster str_caster
bool none = false
CharT one_char = 0

Public Static Functions

static inline handle cast(const CharT *src, return_value_policy policy, handle parent)
static inline handle cast(CharT src, return_value_policy policy, handle parent)
static inline handle cast(const CharT *src, return_value_policy policy, handle parent)
static inline handle cast(CharT src, return_value_policy policy, handle parent)

Public Static Attributes

static constexpr auto name = _(PYBIND11_STRING_NAME)
template<typename Type, size_t Size>
struct type_caster<std::array<Type, Size>> : public array_caster<std::array<Type, Size>, Type, false, Size>, public array_caster<std::array<Type, Size>, Type, false, Size>
#include <stl.h>
template<typename CharT, class Traits, class Allocator>
struct type_caster<std::basic_string<CharT, Traits, Allocator>, enable_if_t<is_std_char_type<CharT>::value>> : public string_caster<std::basic_string<CharT, Traits, Allocator>>, public string_caster<std::basic_string<CharT, Traits, Allocator>>
#include <cast.h>
template<typename Rep, typename Period>
class type_caster<std::chrono::duration<Rep, Period>> : public duration_caster<std::chrono::duration<Rep, Period>>, public duration_caster<std::chrono::duration<Rep, Period>>
#include <chrono.h>
template<typename Clock, typename Duration>
class type_caster<std::chrono::time_point<Clock, Duration>> : public duration_caster<std::chrono::time_point<Clock, Duration>>, public duration_caster<std::chrono::time_point<Clock, Duration>>
#include <chrono.h>
template<typename Duration>
class type_caster<std::chrono::time_point<std::chrono::system_clock, Duration>>
#include <chrono.h>

Public Types

typedef std::chrono::time_point<std::chrono::system_clock, Duration> type
typedef std::chrono::time_point<std::chrono::system_clock, Duration> type

Public Functions

inline bool load(handle src, bool)
PYBIND11_TYPE_CASTER (type, _("datetime.datetime"))
inline bool load(handle src, bool)
PYBIND11_TYPE_CASTER (type, _("datetime.datetime"))

Public Static Functions

static inline handle cast(const std::chrono::time_point<std::chrono::system_clock, Duration> &src, return_value_policy, handle)
static inline handle cast(const std::chrono::time_point<std::chrono::system_clock, Duration> &src, return_value_policy, handle)
template<typename T>
class type_caster<std::complex<T>>
#include <complex.h>

Public Functions

inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (std::complex< T >, _("complex"))
inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (std::complex< T >, _("complex"))

Public Static Functions

static inline handle cast(const std::complex<T> &src, return_value_policy, handle)
static inline handle cast(const std::complex<T> &src, return_value_policy, handle)
template<typename Type, typename Alloc>
struct type_caster<std::deque<Type, Alloc>> : public list_caster<std::deque<Type, Alloc>, Type>, public list_caster<std::deque<Type, Alloc>, Type>
#include <stl.h>
template<typename Return, typename ...Args>
struct type_caster<std::function<Return(Args...)>>
#include <functional.h>

Public Types

using type = std::function<Return(Args...)>
using retval_type = conditional_t<std::is_same<Return, void>::value, void_type, Return>
using function_type = Return (*)(Args...)
using type = std::function<Return(Args...)>
using retval_type = conditional_t<std::is_same<Return, void>::value, void_type, Return>
using function_type = Return (*)(Args...)

Public Functions

inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (type, _("Callable[[")+concat(make_caster< Args >::name...)+_("], ")+make_caster< retval_type >::name+_("]"))
inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (type, _("Callable[[")+concat(make_caster< Args >::name...)+_("], ")+make_caster< retval_type >::name+_("]"))

Public Static Functions

template<typename Func>
static inline handle cast(Func &&f_, return_value_policy policy, handle)
template<typename Func>
static inline handle cast(Func &&f_, return_value_policy policy, handle)
template<typename Type, typename Alloc>
struct type_caster<std::list<Type, Alloc>> : public list_caster<std::list<Type, Alloc>, Type>, public list_caster<std::list<Type, Alloc>, Type>
#include <stl.h>
template<typename Key, typename Value, typename Compare, typename Alloc>
struct type_caster<std::map<Key, Value, Compare, Alloc>> : public map_caster<std::map<Key, Value, Compare, Alloc>, Key, Value>, public map_caster<std::map<Key, Value, Compare, Alloc>, Key, Value>
#include <stl.h>
template<>
class type_caster<std::nullptr_t> : public void_caster<std::nullptr_t>, public void_caster<std::nullptr_t>
#include <cast.h>
template<typename T1, typename T2>
class type_caster<std::pair<T1, T2>> : public tuple_caster<std::pair, T1, T2>, public tuple_caster<std::pair, T1, T2>
#include <cast.h>
template<typename type>
class type_caster<std::reference_wrapper<type>>
#include <cast.h>

Public Types

using cast_op_type = std::reference_wrapper<type>
using cast_op_type = std::reference_wrapper<type>

Public Functions

inline bool load(handle src, bool convert)
inline operator std::reference_wrapper<type>()
inline bool load(handle src, bool convert)
inline operator std::reference_wrapper<type>()

Public Static Functions

static inline handle cast(const std::reference_wrapper<type> &src, return_value_policy policy, handle parent)
static inline handle cast(const std::reference_wrapper<type> &src, return_value_policy policy, handle parent)

Public Static Attributes

static constexpr auto name = caster_t::name

Private Types

using caster_t = make_caster<type>
using subcaster_cast_op_type = typename caster_t::template cast_op_type<type>
using caster_t = make_caster<type>
using subcaster_cast_op_type = typename caster_t::template cast_op_type<type>

Private Members

caster_t subcaster
template<typename Key, typename Compare, typename Alloc>
struct type_caster<std::set<Key, Compare, Alloc>> : public set_caster<std::set<Key, Compare, Alloc>, Key>, public set_caster<std::set<Key, Compare, Alloc>, Key>
#include <stl.h>
template<typename T>
class type_caster<std::shared_ptr<T>> : public copyable_holder_caster<T, std::shared_ptr<T>>, public copyable_holder_caster<T, std::shared_ptr<T>>
#include <cast.h>

Specialize for the common std::shared_ptr, so users don’t need to.

template<typename ...Ts>
class type_caster<std::tuple<Ts...>> : public tuple_caster<std::tuple, Ts...>, public tuple_caster<std::tuple, Ts...>
#include <cast.h>
template<typename type, typename deleter>
class type_caster<std::unique_ptr<type, deleter>> : public move_only_holder_caster<type, std::unique_ptr<type, deleter>>, public move_only_holder_caster<type, std::unique_ptr<type, deleter>>
#include <cast.h>
template<typename Key, typename Value, typename Hash, typename Equal, typename Alloc>
struct type_caster<std::unordered_map<Key, Value, Hash, Equal, Alloc>> : public map_caster<std::unordered_map<Key, Value, Hash, Equal, Alloc>, Key, Value>, public map_caster<std::unordered_map<Key, Value, Hash, Equal, Alloc>, Key, Value>
#include <stl.h>
template<typename Key, typename Hash, typename Equal, typename Alloc>
struct type_caster<std::unordered_set<Key, Hash, Equal, Alloc>> : public set_caster<std::unordered_set<Key, Hash, Equal, Alloc>, Key>, public set_caster<std::unordered_set<Key, Hash, Equal, Alloc>, Key>
#include <stl.h>
template<typename Type>
struct type_caster<std::valarray<Type>> : public array_caster<std::valarray<Type>, Type, true>, public array_caster<std::valarray<Type>, Type, true>
#include <stl.h>
template<typename Type, typename Alloc>
struct type_caster<std::vector<Type, Alloc>> : public list_caster<std::vector<Type, Alloc>, Type>, public list_caster<std::vector<Type, Alloc>, Type>
#include <stl.h>
template<typename T>
class type_caster<T, enable_if_t<is_pyobject<T>::value>> : public pyobject_caster<T>, public pyobject_caster<T>
#include <cast.h>
template<typename T>
struct type_caster<T, enable_if_t<std::is_arithmetic<T>::value && !is_std_char_type<T>::value>>
#include <cast.h>

Public Types

using _py_type_0 = conditional_t<sizeof(T) <= sizeof(long), long, long long>
using _py_type_1 = conditional_t<std::is_signed<T>::value, _py_type_0, typename std::make_unsigned<_py_type_0>::type>
using py_type = conditional_t<std::is_floating_point<T>::value, double, _py_type_1>
using _py_type_0 = conditional_t<sizeof(T) <= sizeof(long), long, long long>
using _py_type_1 = conditional_t<std::is_signed<T>::value, _py_type_0, typename std::make_unsigned<_py_type_0>::type>
using py_type = conditional_t<std::is_floating_point<T>::value, double, _py_type_1>

Public Functions

inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (T, _< std::is_integral< T >::value >("int", "float"))
inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (T, _< std::is_integral< T >::value >("int", "float"))

Public Static Functions

template<typename U = T>
static inline std::enable_if<std::is_floating_point<U>::value, handle>::type cast(U src, return_value_policy, handle)
template<typename U = T>
static inline std::enable_if<!std::is_floating_point<U>::value && std::is_signed<U>::value && (sizeof(U) <= sizeof(long)), handle>::type cast(U src, return_value_policy, handle)
template<typename U = T>
static inline std::enable_if<!std::is_floating_point<U>::value && std::is_unsigned<U>::value && (sizeof(U) <= sizeof(unsigned long)), handle>::type cast(U src, return_value_policy, handle)
template<typename U = T>
static inline std::enable_if<!std::is_floating_point<U>::value && std::is_signed<U>::value && (sizeof(U) > sizeof(long)), handle>::type cast(U src, return_value_policy, handle)
template<typename U = T>
static inline std::enable_if<!std::is_floating_point<U>::value && std::is_unsigned<U>::value && (sizeof(U) > sizeof(unsigned long)), handle>::type cast(U src, return_value_policy, handle)
template<typename U = T>
static inline std::enable_if<std::is_floating_point<U>::value, handle>::type cast(U src, return_value_policy, handle)
template<typename U = T>
static inline std::enable_if<!std::is_floating_point<U>::value && std::is_signed<U>::value && (sizeof(U) <= sizeof(long)), handle>::type cast(U src, return_value_policy, handle)
template<typename U = T>
static inline std::enable_if<!std::is_floating_point<U>::value && std::is_unsigned<U>::value && (sizeof(U) <= sizeof(unsigned long)), handle>::type cast(U src, return_value_policy, handle)
template<typename U = T>
static inline std::enable_if<!std::is_floating_point<U>::value && std::is_signed<U>::value && (sizeof(U) > sizeof(long)), handle>::type cast(U src, return_value_policy, handle)
template<typename U = T>
static inline std::enable_if<!std::is_floating_point<U>::value && std::is_unsigned<U>::value && (sizeof(U) > sizeof(unsigned long)), handle>::type cast(U src, return_value_policy, handle)
template<typename Type>
struct type_caster<Type, enable_if_t<is_eigen_dense_map<Type>::value>> : public eigen_map_caster<Type>, public eigen_map_caster<Type>
#include <eigen.h>
template<typename Type>
struct type_caster<Type, enable_if_t<is_eigen_dense_plain<Type>::value>>
#include <eigen.h>

Public Types

using Scalar = typename Type::Scalar
using props = EigenProps<Type>
using cast_op_type = movable_cast_op_type<T>
using Scalar = typename Type::Scalar
using props = EigenProps<Type>
using cast_op_type = movable_cast_op_type<T>

Public Functions

inline bool load(handle src, bool convert)
inline operator Type*()
inline operator Type&()
inline operator Type&&() &&
inline bool load(handle src, bool convert)
inline operator Type*()
inline operator Type&()
inline operator Type&&() &&

Public Static Functions

static inline handle cast(Type &&src, return_value_policy, handle parent)
static inline handle cast(const Type &&src, return_value_policy, handle parent)
static inline handle cast(Type &src, return_value_policy policy, handle parent)
static inline handle cast(const Type &src, return_value_policy policy, handle parent)
static inline handle cast(Type *src, return_value_policy policy, handle parent)
static inline handle cast(const Type *src, return_value_policy policy, handle parent)
static inline handle cast(Type &&src, return_value_policy, handle parent)
static inline handle cast(const Type &&src, return_value_policy, handle parent)
static inline handle cast(Type &src, return_value_policy policy, handle parent)
static inline handle cast(const Type &src, return_value_policy policy, handle parent)
static inline handle cast(Type *src, return_value_policy policy, handle parent)
static inline handle cast(const Type *src, return_value_policy policy, handle parent)

Public Static Attributes

static constexpr auto name = props::descriptor

Private Members

Type value

Private Static Functions

template<typename CType>
static inline handle cast_impl(CType *src, return_value_policy policy, handle parent)
template<typename CType>
static inline handle cast_impl(CType *src, return_value_policy policy, handle parent)
template<typename Type>
struct type_caster<Type, enable_if_t<is_eigen_other<Type>::value>>
#include <eigen.h>

Public Types

using cast_op_type = Type
using cast_op_type = Type

Public Functions

bool load(handle, bool) = delete
operator Type() = delete
bool load(handle, bool) = delete
operator Type() = delete

Public Static Functions

static inline handle cast(const Type &src, return_value_policy, handle)
static inline handle cast(const Type *src, return_value_policy policy, handle parent)
static inline handle cast(const Type &src, return_value_policy, handle)
static inline handle cast(const Type *src, return_value_policy policy, handle parent)

Public Static Attributes

static constexpr auto name = props::descriptor

Protected Types

using Matrix = Eigen::Matrix<typename Type::Scalar, Type::RowsAtCompileTime, Type::ColsAtCompileTime>
using props = EigenProps<Matrix>
using Matrix = Eigen::Matrix<typename Type::Scalar, Type::RowsAtCompileTime, Type::ColsAtCompileTime>
using props = EigenProps<Matrix>
template<typename Type>
struct type_caster<Type, enable_if_t<is_eigen_sparse<Type>::value>>
#include <eigen.h>

Public Types

typedef Type::Scalar Scalar
remove_reference_t< decltype(*std::declval< Type >).outerIndexPtr())> StorageIndex
typedef Type::Index Index
typedef Type::Scalar Scalar
remove_reference_t< decltype(*std::declval< Type >).outerIndexPtr())> StorageIndex
typedef Type::Index Index

Public Functions

inline bool load(handle src, bool)
npy_format_descriptor< Scalar >::name _ ("]"))
inline bool load(handle src, bool)
npy_format_descriptor< Scalar >::name _ ("]"))

Public Static Functions

static inline handle cast(const Type &src, return_value_policy, handle)
static inline handle cast(const Type &src, return_value_policy, handle)

Public Static Attributes

static constexpr bool rowMajor = Type::IsRowMajor
template<typename T, ssize_t Dim>
struct type_caster<unchecked_mutable_reference<T, Dim>> : public type_caster<unchecked_reference<T, Dim>>, public type_caster<unchecked_reference<T, Dim>>
#include <numpy.h>
template<typename T, ssize_t Dim>
struct type_caster<unchecked_reference<T, Dim>>
#include <numpy.h>

Subclassed by type_caster< unchecked_mutable_reference< T, Dim > >, type_caster< unchecked_mutable_reference< T, Dim > >

template<>
class type_caster<value_and_holder>
#include <init.h>

Public Types

using cast_op_type = value_and_holder&
using cast_op_type = value_and_holder&

Public Functions

inline bool load(handle h, bool)
inline operator value_and_holder&()
inline bool load(handle h, bool)
inline operator value_and_holder&()

Public Static Attributes

static constexpr auto name = _<value_and_holder>()

Private Members

value_and_holder *value = nullptr
template<>
class type_caster<void> : public type_caster<void_type>, public type_caster<void_type>
#include <cast.h>

Public Types

using cast_op_type = void*&
using cast_op_type = void*&

Public Functions

inline bool load(handle h, bool)
inline operator void*&()
inline bool load(handle h, bool)
inline operator void*&()

Public Static Functions

static inline handle cast(const void *ptr, return_value_policy, handle)
static inline handle cast(const void *ptr, return_value_policy, handle)

Public Static Attributes

static constexpr auto name = _("capsule")

Private Members

void *value = nullptr
template<>
class type_caster<void_type> : public void_caster<void_type>, public void_caster<void_type>
#include <cast.h>

Subclassed by type_caster< void >, type_caster< void >

template<typename type>
class type_caster_base : public type_caster_generic, public type_caster_generic
#include <cast.h>

Generic type caster for objects stored on the heap.

Subclassed by copyable_holder_caster< type, holder_type >, copyable_holder_caster< type, holder_type >, type_caster< type, SFINAE >, type_caster< type, SFINAE >, type_caster< type >, type_caster< type >

Public Types

using cast_op_type = detail::cast_op_type<T>
using cast_op_type = detail::cast_op_type<T>

Public Functions

inline type_caster_base()
inline explicit type_caster_base(const std::type_info &info)
inline operator itype*()
inline operator itype&()
inline type_caster_base()
inline explicit type_caster_base(const std::type_info &info)
inline operator itype*()
inline operator itype&()

Public Static Functions

static inline handle cast(const itype &src, return_value_policy policy, handle parent)
static inline handle cast(itype &&src, return_value_policy, handle parent)
static inline std::pair<const void*, const type_info*> src_and_type(const itype *src)
static inline handle cast(const itype *src, return_value_policy policy, handle parent)
static inline handle cast_holder(const itype *src, const void *holder)
static inline handle cast(const itype &src, return_value_policy policy, handle parent)
static inline handle cast(itype &&src, return_value_policy, handle parent)
static inline std::pair<const void*, const type_info*> src_and_type(const itype *src)
static inline handle cast(const itype *src, return_value_policy policy, handle parent)
static inline handle cast_holder(const itype *src, const void *holder)

Public Static Attributes

static constexpr auto name = _<type>()

Protected Types

using Constructor = void *(*)(const void*)
using Constructor = void *(*)(const void*)

Protected Static Functions

template<typename T, typename = enable_if_t<is_copy_constructible<T>::value>> static inline auto make_copy_constructor (const T *x) -> decltype(new T(*x), Constructor
template<typename T, typename = enable_if_t<std::is_move_constructible<T>::value>> static inline auto make_move_constructor (const T *x) -> decltype(new T(std::move(*const_cast< T *>(x))), Constructor
static inline Constructor make_copy_constructor(...)
static inline Constructor make_move_constructor(...)
template<typename T, typename = enable_if_t<is_copy_constructible<T>::value>> static inline auto make_copy_constructor (const T *x) -> decltype(new T(*x), Constructor
template<typename T, typename = enable_if_t<std::is_move_constructible<T>::value>> static inline auto make_move_constructor (const T *x) -> decltype(new T(std::move(*const_cast< T *>(x))), Constructor
static inline Constructor make_copy_constructor(...)
static inline Constructor make_move_constructor(...)

Private Types

using itype = intrinsic_t<type>
using itype = intrinsic_t<type>
class type_caster_generic
#include <cast.h>

Subclassed by type_caster_base< type >, type_caster_base< type >, type_caster_base< StringType >, type_caster_base< StringType >, type_caster_base< T >, type_caster_base< T >

Public Functions

inline PYBIND11_NOINLINE type_caster_generic(const std::type_info &type_info)
inline type_caster_generic(const type_info *typeinfo)
inline bool load(handle src, bool convert)
inline void load_value(value_and_holder &&v_h)
inline bool try_implicit_casts(handle src, bool convert)
inline bool try_direct_conversions(handle src)
inline void check_holder_compat()
inline PYBIND11_NOINLINE bool try_load_foreign_module_local (handle src)

Try to load with foreign typeinfo, if available.

Used when there is no native typeinfo, or when the native one wasn’t able to produce a value.

template<typename ThisT> inline PYBIND11_NOINLINE bool load_impl (handle src, bool convert)
inline PYBIND11_NOINLINE type_caster_generic(const std::type_info &type_info)
inline type_caster_generic(const type_info *typeinfo)
inline bool load(handle src, bool convert)
inline void load_value(value_and_holder &&v_h)
inline bool try_implicit_casts(handle src, bool convert)
inline bool try_direct_conversions(handle src)
inline void check_holder_compat()
inline PYBIND11_NOINLINE bool try_load_foreign_module_local (handle src)

Try to load with foreign typeinfo, if available.

Used when there is no native typeinfo, or when the native one wasn’t able to produce a value.

template<typename ThisT> inline PYBIND11_NOINLINE bool load_impl (handle src, bool convert)

Public Members

const type_info *typeinfo = nullptr
const std::type_info *cpptype = nullptr
void *value = nullptr

Public Static Functions

static inline PYBIND11_NOINLINE handle cast (const void *_src, return_value_policy policy, handle parent, const detail::type_info *tinfo, void *(*copy_constructor)(const void *), void *(*move_constructor)(const void *), const void *existing_holder=nullptr)
static inline PYBIND11_NOINLINE void * local_load (PyObject *src, const type_info *ti)
static inline PYBIND11_NOINLINE std::pair< const void *, const type_info * > src_and_type (const void *src, const std::type_info &cast_type, const std::type_info *rtti_type=nullptr)
static inline PYBIND11_NOINLINE handle cast (const void *_src, return_value_policy policy, handle parent, const detail::type_info *tinfo, void *(*copy_constructor)(const void *), void *(*move_constructor)(const void *), const void *existing_holder=nullptr)
static inline PYBIND11_NOINLINE void * local_load (PyObject *src, const type_info *ti)
static inline PYBIND11_NOINLINE std::pair< const void *, const type_info * > src_and_type (const void *src, const std::type_info &cast_type, const std::type_info *rtti_type=nullptr)
struct type_equal_to
#include <internals.h>

Public Functions

inline bool operator()(const std::type_index &lhs, const std::type_index &rhs) const
inline bool operator()(const std::type_index &lhs, const std::type_index &rhs) const
struct type_hash
#include <internals.h>

Public Functions

inline size_t operator()(const std::type_index &t) const
inline size_t operator()(const std::type_index &t) const
struct type_info
#include <internals.h>

Additional type information which does not fit into the PyTypeObject.

Changes to this struct also require bumping PYBIND11_INTERNALS_VERSION.

Public Members

PyTypeObject *type
const std::type_info *cpptype
size_t type_size
size_t type_align
size_t holder_size_in_ptrs
void *(*operator_new)(size_t)
void (*init_instance)(instance*, const void*)
void (*dealloc)(value_and_holder &v_h)
std::vector<PyObject *(*)(PyObject*, PyTypeObject*)> implicit_conversions
std::vector<std::pair<const std::type_info*, void *(*)(void*)>> implicit_casts
std::vector<bool (*)(PyObject*, void*&)> *direct_conversions
buffer_info *(* get_buffer )(PyObject *, void *)  = nullptr
void *get_buffer_data = nullptr
void *(* module_local_load )(PyObject *, const type_info *)  = nullptr
bool simple_type
bool simple_ancestors
bool default_holder
bool module_local
template<typename...>
struct type_list
#include <common.h>

Helper template which holds a list of types.

struct type_record
#include <attr.h>

Special data structure which (temporarily) holds metadata about a bound class.

Public Functions

inline PYBIND11_NOINLINE type_record()
inline PYBIND11_NOINLINE void add_base (const std::type_info &base, void *(*caster)(void *))
inline PYBIND11_NOINLINE type_record()
inline PYBIND11_NOINLINE void add_base (const std::type_info &base, void *(*caster)(void *))

Public Members

handle scope

Handle to the parent scope.

const char *name = nullptr

Name of the class.

const std::type_info *type = nullptr
size_t type_size = 0

How large is the underlying C++ type?

size_t type_align = 0

What is the alignment of the underlying C++ type?

size_t holder_size = 0

How large is the type’s holder?

void *(* operator_new )(size_t)  = nullptr

The global operator new can be overridden with a class-specific variant.

void(* init_instance )(instance *, const void *)  = nullptr

Function pointer to class_<..>::init_instance.

void(* dealloc )(detail::value_and_holder &)  = nullptr

Function pointer to class_<..>::dealloc.

list bases

List of base classes of the newly created type.

const char *doc = nullptr

Optional docstring.

handle metaclass

Custom metaclass (optional)

bool multiple_inheritance

Multiple inheritance marker.

bool dynamic_attr

Does the class manage a dict?

bool buffer_protocol

Does the class implement the buffer protocol?

bool default_holder

Is the default (unique_ptr) holder type used?

bool module_local

Is the class definition local to the module shared object?

template<typename T>
class TypedTest : public Test, public testing::Test, public testing::Test, public testing::Test, public Test
template<typename T>
class TypedTest1 : public testing::Test
template<typename T>
class TypedTest2 : public testing::Test
class TypedTestNames

Public Static Functions

template<typename T>
static inline std::string GetName(int i)
template<typename T>
static inline std::string GetName(int i)
template<typename T>
class TypedTestP : public testing::Test, public Test
template<typename T>
class TypedTestP1 : public testing::Test
template<typename T>
class TypedTestP2 : public testing::Test
class TypedTestPNames

Public Static Functions

template<typename T>
static inline std::string GetName(int i)
class TypedTestSuitePStateTest : public testing::Test

Protected Functions

inline virtual void SetUp() override

Protected Attributes

TypedTestSuitePState state_
template<typename T>
class TypedTestWithNames : public testing::Test, public testing::Test
template<typename T>
class TypeParameterizedTestSuite : public Test, public testing::Test
class TypeParametrizedTestNames

Public Static Functions

template<typename T>
static inline std::string GetName(int i)
template<typename T>
class TypeParametrizedTestWithNames : public testing::Test
template<typename T>
class TypeParamTest : public testing::Test
struct testing::gmock_more_actions_test::UnaryFunctor

Public Functions

inline int operator()(bool x)
template<typename T, ssize_t Dims>
class unchecked_mutable_reference : public unchecked_reference<T, Dims>, public unchecked_reference<T, Dims>
#include <numpy.h>

Public Functions

template<typename ...Ix>
inline T &operator()(Ix... index)

Mutable, unchecked access to data at the given indices.

template<ssize_t D = Dims, typename = enable_if_t<D == 1 || Dynamic>>
inline T &operator[](ssize_t index)

Mutable, unchecked access data at the given index; this operator only participates if the reference is to a 1-dimensional array (or has runtime dimensions).

When present, this is exactly equivalent to obj(index).

template<typename ...Ix>
inline T *mutable_data(Ix... ix)

Mutable pointer access to the data at the given indices.

template<typename ...Ix>
inline T &operator()(Ix... index)

Mutable, unchecked access to data at the given indices.

template<ssize_t D = Dims, typename = enable_if_t<D == 1 || Dynamic>>
inline T &operator[](ssize_t index)

Mutable, unchecked access data at the given index; this operator only participates if the reference is to a 1-dimensional array (or has runtime dimensions).

When present, this is exactly equivalent to obj(index).

template<typename ...Ix>
inline T *mutable_data(Ix... ix)

Mutable pointer access to the data at the given indices.

Private Types

using ConstBase = unchecked_reference<T, Dims>
using ConstBase = unchecked_reference<T, Dims>

Friends

friend class pybind11::array
template<typename T, ssize_t Dims>
class unchecked_reference
#include <numpy.h>

Proxy class providing unsafe, unchecked const access to array data.

This is constructed through the unchecked<T, N>() method of array or the unchecked<N>() method of array_t<T>. Dims will be -1 for dimensions determined at runtime.

Subclassed by unchecked_mutable_reference< T, Dims >, unchecked_mutable_reference< T, Dims >

Public Functions

template<typename ...Ix>
inline const T &operator()(Ix... index) const

Unchecked const reference access to data at the given indices.

For a compile-time known number of dimensions, this requires the correct number of arguments; for run-time dimensionality, this is not checked (and so is up to the caller to use safely).

template<ssize_t D = Dims, typename = enable_if_t<D == 1 || Dynamic>>
inline const T &operator[](ssize_t index) const

Unchecked const reference access to data; this operator only participates if the reference is to a 1-dimensional array.

When present, this is exactly equivalent to obj(index).

template<typename ...Ix>
inline const T *data(Ix... ix) const

Pointer access to the data at the given indices.

inline ssize_t shape(ssize_t dim) const

Returns the shape (i.e. size) of dimension dim

inline ssize_t ndim() const

Returns the number of dimensions of the array.

template<bool Dyn = Dynamic>
inline enable_if_t<!Dyn, ssize_t> size() const

Returns the total number of elements in the referenced array, i.e. the product of the shapes.

template<bool Dyn = Dynamic>
inline enable_if_t<Dyn, ssize_t> size() const
inline ssize_t nbytes() const

Returns the total number of bytes used by the referenced data.

Note that the actual span in memory may be larger if the referenced array has non-contiguous strides (e.g. for a slice).

template<typename ...Ix>
inline const T &operator()(Ix... index) const

Unchecked const reference access to data at the given indices.

For a compile-time known number of dimensions, this requires the correct number of arguments; for run-time dimensionality, this is not checked (and so is up to the caller to use safely).

template<ssize_t D = Dims, typename = enable_if_t<D == 1 || Dynamic>>
inline const T &operator[](ssize_t index) const

Unchecked const reference access to data; this operator only participates if the reference is to a 1-dimensional array.

When present, this is exactly equivalent to obj(index).

template<typename ...Ix>
inline const T *data(Ix... ix) const

Pointer access to the data at the given indices.

inline ssize_t shape(ssize_t dim) const

Returns the shape (i.e. size) of dimension dim

inline ssize_t ndim() const

Returns the number of dimensions of the array.

template<bool Dyn = Dynamic>
inline enable_if_t<!Dyn, ssize_t> size() const

Returns the total number of elements in the referenced array, i.e. the product of the shapes.

template<bool Dyn = Dynamic>
inline enable_if_t<Dyn, ssize_t> size() const
inline ssize_t nbytes() const

Returns the total number of bytes used by the referenced data.

Note that the actual span in memory may be larger if the referenced array has non-contiguous strides (e.g. for a slice).

Public Static Functions

static inline constexpr ssize_t itemsize()

Returns the item size, i.e. sizeof(T)

static inline constexpr ssize_t itemsize()

Returns the item size, i.e. sizeof(T)

Protected Functions

template<bool Dyn = Dynamic>
inline unchecked_reference(const void *data, const ssize_t *shape, const ssize_t *strides, enable_if_t<!Dyn, ssize_t>)
template<bool Dyn = Dynamic>
inline unchecked_reference(const void *data, const ssize_t *shape, const ssize_t *strides, enable_if_t<Dyn, ssize_t> dims)
template<bool Dyn = Dynamic>
inline unchecked_reference(const void *data, const ssize_t *shape, const ssize_t *strides, enable_if_t<!Dyn, ssize_t>)
template<bool Dyn = Dynamic>
inline unchecked_reference(const void *data, const ssize_t *shape, const ssize_t *strides, enable_if_t<Dyn, ssize_t> dims)

Protected Attributes

const unsigned char *data_
conditional_t<Dynamic, const ssize_t*, std::array<ssize_t, (size_t)Dims>> shape_
conditional_t<Dynamic, const ssize_t*, std::array<ssize_t, (size_t)Dims>> strides_
const ssize_t dims_

Protected Static Attributes

static constexpr bool Dynamic = Dims < 0

Friends

friend class pybind11::array
struct undefined_t
#include <operators.h>

Type for an unused type slot.

class testing::UnitTest
#include <gtest.h>

Public Functions

int Run () GTEST_MUST_USE_RESULT_
const char *original_working_dir() const
const TestSuite * current_test_suite () const GTEST_LOCK_EXCLUDED_(mutex_)
const TestCase * current_test_case () const GTEST_LOCK_EXCLUDED_(mutex_)
const TestInfo * current_test_info () const GTEST_LOCK_EXCLUDED_(mutex_)
int random_seed() const
internal::ParameterizedTestSuiteRegistry & parameterized_test_registry () GTEST_LOCK_EXCLUDED_(mutex_)
int successful_test_suite_count() const
int failed_test_suite_count() const
int total_test_suite_count() const
int test_suite_to_run_count() const
int successful_test_case_count() const
int failed_test_case_count() const
int total_test_case_count() const
int test_case_to_run_count() const
int successful_test_count() const
int skipped_test_count() const
int failed_test_count() const
int reportable_disabled_test_count() const
int disabled_test_count() const
int reportable_test_count() const
int total_test_count() const
int test_to_run_count() const
TimeInMillis start_timestamp() const
TimeInMillis elapsed_time() const
bool Passed() const
bool Failed() const
const TestSuite *GetTestSuite(int i) const
const TestCase *GetTestCase(int i) const
const TestResult &ad_hoc_test_result() const
TestEventListeners &listeners()
int Run () GTEST_MUST_USE_RESULT_
const char *original_working_dir() const
const TestSuite * current_test_suite () const GTEST_LOCK_EXCLUDED_(mutex_)
const TestCase * current_test_case () const GTEST_LOCK_EXCLUDED_(mutex_)
const TestInfo * current_test_info () const GTEST_LOCK_EXCLUDED_(mutex_)
int random_seed() const
internal::ParameterizedTestSuiteRegistry & parameterized_test_registry () GTEST_LOCK_EXCLUDED_(mutex_)
int successful_test_suite_count() const
int failed_test_suite_count() const
int total_test_suite_count() const
int test_suite_to_run_count() const
int successful_test_case_count() const
int failed_test_case_count() const
int total_test_case_count() const
int test_case_to_run_count() const
int successful_test_count() const
int skipped_test_count() const
int failed_test_count() const
int reportable_disabled_test_count() const
int disabled_test_count() const
int reportable_test_count() const
int total_test_count() const
int test_to_run_count() const
TimeInMillis start_timestamp() const
TimeInMillis elapsed_time() const
bool Passed() const
bool Failed() const
const TestSuite *GetTestSuite(int i) const
const TestCase *GetTestCase(int i) const
const TestResult &ad_hoc_test_result() const
TestEventListeners &listeners()

Public Static Functions

static UnitTest *GetInstance()
static UnitTest *GetInstance()

Private Functions

Environment *AddEnvironment(Environment *env)
void AddTestPartResult (TestPartResult::Type result_type, const char *file_name, int line_number, const std::string &message, const std::string &os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_)
void RecordProperty(const std::string &key, const std::string &value)
TestSuite *GetMutableTestSuite(int i)
inline internal::UnitTestImpl *impl()
inline const internal::UnitTestImpl *impl() const
UnitTest()
virtual ~UnitTest()
void PushGTestTrace (const internal::TraceInfo &trace) GTEST_LOCK_EXCLUDED_(mutex_)
void PopGTestTrace () GTEST_LOCK_EXCLUDED_(mutex_)
GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest)
Environment *AddEnvironment(Environment *env)
void AddTestPartResult (TestPartResult::Type result_type, const char *file_name, int line_number, const std::string &message, const std::string &os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_)
void RecordProperty(const std::string &key, const std::string &value)
TestSuite *GetMutableTestSuite(int i)
inline internal::UnitTestImpl *impl()
inline const internal::UnitTestImpl *impl() const
UnitTest()
virtual ~UnitTest()
void PushGTestTrace (const internal::TraceInfo &trace) GTEST_LOCK_EXCLUDED_(mutex_)
void PopGTestTrace () GTEST_LOCK_EXCLUDED_(mutex_)
GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest)

Private Members

mutable internal::Mutex mutex_
internal::UnitTestImpl *impl_

Friends

friend class ScopedTrace
friend class Test
friend class internal::AssertHelper
friend class internal::StreamingListenerTest
friend class internal::UnitTestRecordPropertyTestHelper
friend friend Environment * AddGlobalTestEnvironment (Environment *env)
friend friend std::set< std::string > * internal::GetIgnoredParameterizedTestSuites ()
friend friend internal::UnitTestImpl * internal::GetUnitTestImpl ()
friend friend void internal::ReportFailureInUnknownLocation (TestPartResult::Type result_type, const std::string &message)
friend friend Environment * AddGlobalTestEnvironment (Environment *env)
friend friend std::set< std::string > * internal::GetIgnoredParameterizedTestSuites ()
friend friend internal::UnitTestImpl * internal::GetUnitTestImpl ()
friend friend void internal::ReportFailureInUnknownLocation (TestPartResult::Type result_type, const std::string &message)
class testing::internal::UnitTestHelper

Public Static Functions

static inline TestSuite const **GetSortedTestSuites()
static inline const TestSuite *FindTestSuite(const char *name)
static inline TestInfo const **GetSortedTests(const TestSuite *test_suite)
class testing::internal::UnitTestRecordPropertyTestHelper : public testing::Test

Protected Functions

inline UnitTestRecordPropertyTestHelper()
inline void UnitTestRecordProperty(const char *key, const std::string &value)

Protected Attributes

UnitTest unit_test_
template<typename T>
class testing::internal::UniversalPrinter
#include <gtest-printers.h>

Subclassed by testing::internal::UniversalPrinter< const T >, testing::internal::UniversalPrinter< const T >

Public Static Functions

static inline void Print(const T &value, ::std::ostream *os)
static inline void Print(const T &value, ::std::ostream *os)
template<typename T>
class UniversalPrinter<const T> : public testing::internal::UniversalPrinter<T>, public testing::internal::UniversalPrinter<T>
#include <gtest-printers.h>
template<typename T>
class testing::internal::UniversalPrinter<T&>
#include <gtest-printers.h>

Public Static Functions

static inline void Print(const T &value, ::std::ostream *os)
static inline void Print(const T &value, ::std::ostream *os)
template<typename T, size_t N>
class testing::internal::UniversalPrinter<T[N]>
#include <gtest-printers.h>

Public Static Functions

static inline void Print(const T (&a)[N], ::std::ostream *os)
static inline void Print(const T (&a)[N], ::std::ostream *os)
template<typename T>
class testing::internal::UniversalPrinter<Wrapper<T>>

Public Static Functions

static inline void Print(const Wrapper<T> &w, ::std::ostream *os)
template<typename T>
class testing::internal::UniversalTersePrinter
#include <gtest-printers.h>

Public Static Functions

static inline void Print(const T &value, ::std::ostream *os)
static inline void Print(const T &value, ::std::ostream *os)
template<>
class UniversalTersePrinter<char*> : public testing::internal::UniversalTersePrinter<const char*>, public testing::internal::UniversalTersePrinter<const char*>
#include <gtest-printers.h>
template<>
class UniversalTersePrinter<char16_t*> : public testing::internal::UniversalTersePrinter<const char16_t*>, public testing::internal::UniversalTersePrinter<const char16_t*>
#include <gtest-printers.h>
template<>
class UniversalTersePrinter<char32_t*> : public testing::internal::UniversalTersePrinter<const char32_t*>, public testing::internal::UniversalTersePrinter<const char32_t*>
#include <gtest-printers.h>
template<>
class testing::internal::UniversalTersePrinter<const char*>
#include <gtest-printers.h>

Public Static Functions

static inline void Print(const char *str, ::std::ostream *os)
static inline void Print(const char *str, ::std::ostream *os)
template<>
class testing::internal::UniversalTersePrinter<const char16_t*>
#include <gtest-printers.h>

Public Static Functions

static inline void Print(const char16_t *str, ::std::ostream *os)
static inline void Print(const char16_t *str, ::std::ostream *os)
template<>
class testing::internal::UniversalTersePrinter<const char32_t*>
#include <gtest-printers.h>

Public Static Functions

static inline void Print(const char32_t *str, ::std::ostream *os)
static inline void Print(const char32_t *str, ::std::ostream *os)
template<typename T>
class testing::internal::UniversalTersePrinter<T&>
#include <gtest-printers.h>

Public Static Functions

static inline void Print(const T &value, ::std::ostream *os)
static inline void Print(const T &value, ::std::ostream *os)
template<typename T, size_t N>
class testing::internal::UniversalTersePrinter<T[N]>
#include <gtest-printers.h>

Public Static Functions

static inline void Print(const T (&value)[N], ::std::ostream *os)
static inline void Print(const T (&value)[N], ::std::ostream *os)
template<>
class testing::internal::UniversalTersePrinter<wchar_t*>
#include <gtest-printers.h>

Public Static Functions

static inline void Print(wchar_t *str, ::std::ostream *os)
static inline void Print(wchar_t *str, ::std::ostream *os)
template<return_value_policy policy>
class unpacking_collector
#include <cast.h>

Helper class which collects positional, keyword, * and ** arguments for a Python function call.

Public Functions

template<typename ...Ts>
inline explicit unpacking_collector(Ts&&... values)
inline const tuple &args() const &
inline const dict &kwargs() const &
inline tuple args() &&
inline dict kwargs() &&
inline object call(PyObject *ptr) const

Call a Python function and pass the collected arguments.

template<typename ...Ts>
inline explicit unpacking_collector(Ts&&... values)
inline const tuple &args() const &
inline const dict &kwargs() const &
inline tuple args() &&
inline dict kwargs() &&
inline object call(PyObject *ptr) const

Call a Python function and pass the collected arguments.

Private Functions

template<typename T>
inline void process(list &args_list, T &&x)
inline void process(list &args_list, detail::args_proxy ap)
inline void process(list&, arg_v a)
inline void process(list&, detail::kwargs_proxy kp)
template<typename T>
inline void process(list &args_list, T &&x)
inline void process(list &args_list, detail::args_proxy ap)
inline void process(list&, arg_v a)
inline void process(list&, detail::kwargs_proxy kp)

Private Members

tuple m_args
dict m_kwargs

Private Static Functions

static inline void nameless_argument_error()
static inline void nameless_argument_error(std::string type)
static inline void multiple_values_error()
static inline void multiple_values_error(std::string name)
static inline void argument_cast_error()
static inline void argument_cast_error(std::string name, std::string type)
static inline void nameless_argument_error()
static inline void nameless_argument_error(std::string type)
static inline void multiple_values_error()
static inline void multiple_values_error(std::string name)
static inline void argument_cast_error()
static inline void argument_cast_error(std::string name, std::string type)
class foo::UnprintableInFoo

Public Functions

inline UnprintableInFoo()
inline double z() const

Private Members

char xy_[8]
double z_
template<typename T>
class UnprintableTemplateInGlobal

Public Functions

inline UnprintableTemplateInGlobal()

Private Members

T value_
class Unstreamable

Public Functions

inline explicit Unstreamable(int value)
inline const int &dummy_value() const

Private Members

int value_
template<typename PlainObjectType, typename StrideType>
struct type_caster<Eigen::Ref<PlainObjectType, 0, StrideType>, enable_if_t<is_eigen_dense_map<Eigen::Ref<PlainObjectType, 0, StrideType>>::value>> : public eigen_map_caster<Eigen::Ref<PlainObjectType, 0, StrideType>>, public eigen_map_caster<Eigen::Ref<PlainObjectType, 0, StrideType>>
#include <eigen.h>

Public Types

using cast_op_type = pybind11::detail::cast_op_type<_T>
using cast_op_type = pybind11::detail::cast_op_type<_T>

Public Functions

inline bool load(handle src, bool convert)
inline operator Type*()
inline operator Type&()
inline bool load(handle src, bool convert)
inline operator Type*()
inline operator Type&()

Private Types

using Type = Eigen::Ref<PlainObjectType, 0, StrideType>
using props = EigenProps<Type>
using Scalar = typename props::Scalar
using MapType = Eigen::Map<PlainObjectType, 0, StrideType>
Array = array_t< Scalar, array::forcecast|((props::row_major ? props::inner_stride :props::outer_stride)==1 ? array::c_style :(props::row_major ? props::outer_stride :props::inner_stride)==1 ? array::f_style :0)>
using stride_ctor_default = bool_constant<S::InnerStrideAtCompileTime != Eigen::Dynamic && S::OuterStrideAtCompileTime != Eigen::Dynamic && std::is_default_constructible<S>::value>
using stride_ctor_dual = bool_constant<!stride_ctor_default<S>::value && std::is_constructible<S, EigenIndex, EigenIndex>::value>
using stride_ctor_outer = bool_constant<!any_of<stride_ctor_default<S>, stride_ctor_dual<S>>::value && S::OuterStrideAtCompileTime == Eigen::Dynamic && S::InnerStrideAtCompileTime != Eigen::Dynamic && std::is_constructible<S, EigenIndex>::value>
using stride_ctor_inner = bool_constant<!any_of<stride_ctor_default<S>, stride_ctor_dual<S>>::value && S::InnerStrideAtCompileTime == Eigen::Dynamic && S::OuterStrideAtCompileTime != Eigen::Dynamic && std::is_constructible<S, EigenIndex>::value>
using Type = Eigen::Ref<PlainObjectType, 0, StrideType>
using props = EigenProps<Type>
using Scalar = typename props::Scalar
using MapType = Eigen::Map<PlainObjectType, 0, StrideType>
Array = array_t< Scalar, array::forcecast|((props::row_major ? props::inner_stride :props::outer_stride)==1 ? array::c_style :(props::row_major ? props::outer_stride :props::inner_stride)==1 ? array::f_style :0)>
using stride_ctor_default = bool_constant<S::InnerStrideAtCompileTime != Eigen::Dynamic && S::OuterStrideAtCompileTime != Eigen::Dynamic && std::is_default_constructible<S>::value>
using stride_ctor_dual = bool_constant<!stride_ctor_default<S>::value && std::is_constructible<S, EigenIndex, EigenIndex>::value>
using stride_ctor_outer = bool_constant<!any_of<stride_ctor_default<S>, stride_ctor_dual<S>>::value && S::OuterStrideAtCompileTime == Eigen::Dynamic && S::InnerStrideAtCompileTime != Eigen::Dynamic && std::is_constructible<S, EigenIndex>::value>
using stride_ctor_inner = bool_constant<!any_of<stride_ctor_default<S>, stride_ctor_dual<S>>::value && S::InnerStrideAtCompileTime == Eigen::Dynamic && S::OuterStrideAtCompileTime != Eigen::Dynamic && std::is_constructible<S, EigenIndex>::value>

Private Functions

template<typename T = Type, enable_if_t<is_eigen_mutable_map<T>::value, int> = 0>
inline Scalar *data(Array &a)
template<typename T = Type, enable_if_t<!is_eigen_mutable_map<T>::value, int> = 0>
inline const Scalar *data(Array &a)
template<typename T = Type, enable_if_t<is_eigen_mutable_map<T>::value, int> = 0>
inline Scalar *data(Array &a)
template<typename T = Type, enable_if_t<!is_eigen_mutable_map<T>::value, int> = 0>
inline const Scalar *data(Array &a)

Private Members

std::unique_ptr<MapType> map
std::unique_ptr<Type> ref
Array copy_or_ref

Private Static Functions

template<typename S = StrideType, enable_if_t<stride_ctor_default<S>::value, int> = 0>
static inline S make_stride(EigenIndex, EigenIndex)
template<typename S = StrideType, enable_if_t<stride_ctor_dual<S>::value, int> = 0>
static inline S make_stride(EigenIndex outer, EigenIndex inner)
template<typename S = StrideType, enable_if_t<stride_ctor_outer<S>::value, int> = 0>
static inline S make_stride(EigenIndex outer, EigenIndex)
template<typename S = StrideType, enable_if_t<stride_ctor_inner<S>::value, int> = 0>
static inline S make_stride(EigenIndex, EigenIndex inner)
template<typename S = StrideType, enable_if_t<stride_ctor_default<S>::value, int> = 0>
static inline S make_stride(EigenIndex, EigenIndex)
template<typename S = StrideType, enable_if_t<stride_ctor_dual<S>::value, int> = 0>
static inline S make_stride(EigenIndex outer, EigenIndex inner)
template<typename S = StrideType, enable_if_t<stride_ctor_outer<S>::value, int> = 0>
static inline S make_stride(EigenIndex outer, EigenIndex)
template<typename S = StrideType, enable_if_t<stride_ctor_inner<S>::value, int> = 0>
static inline S make_stride(EigenIndex, EigenIndex inner)

Private Static Attributes

static constexpr bool need_writeable = is_eigen_mutable_map<Type>::value
struct value_and_holder
#include <cast.h>

Public Functions

inline value_and_holder(instance *i, const detail::type_info *type, size_t vpos, size_t index)
inline value_and_holder()
inline value_and_holder(size_t index)
template<typename V = void>
inline V *&value_ptr() const
inline explicit operator bool() const
template<typename H>
inline H &holder() const
inline bool holder_constructed() const
inline void set_holder_constructed(bool v = true)
inline bool instance_registered() const
inline void set_instance_registered(bool v = true)
inline value_and_holder(instance *i, const detail::type_info *type, size_t vpos, size_t index)
inline value_and_holder()
inline value_and_holder(size_t index)
template<typename V = void>
inline V *&value_ptr() const
inline explicit operator bool() const
template<typename H>
inline H &holder() const
inline bool holder_constructed() const
inline void set_holder_constructed(bool v = true)
inline bool instance_registered() const
inline void set_instance_registered(bool v = true)

Public Members

instance *inst = nullptr
size_t index = 0u
const detail::type_info *type = nullptr
void **vh = nullptr
class ValueParamTest : public testing::TestWithParam<int>, public testing::TestWithParam<int>, public testing::TestWithParam<MyType>
class testing::DefaultValue::ValueProducer

Subclassed by testing::DefaultValue< T >::FactoryValueProducer, testing::DefaultValue< T >::FactoryValueProducer, testing::DefaultValue< T >::FixedValueProducer, testing::DefaultValue< T >::FixedValueProducer

Public Functions

inline virtual ~ValueProducer()
virtual T Produce() = 0
inline virtual ~ValueProducer()
virtual T Produce() = 0
struct values_and_holders
#include <cast.h>

Public Functions

inline values_and_holders(instance *inst)
inline iterator begin()
inline iterator end()
inline iterator find(const type_info *find_type)
inline size_t size()
inline values_and_holders(instance *inst)
inline iterator begin()
inline iterator end()
inline iterator find(const type_info *find_type)
inline size_t size()

Private Types

using type_vec = std::vector<detail::type_info*>
using type_vec = std::vector<detail::type_info*>

Private Members

instance *inst
const type_vec &tinfo
template<typename Variant>
struct variant_caster
#include <stl.h>

Generic variant caster.

template<template<typename...> class V, typename ...Ts>
struct variant_caster<V<Ts...>>
#include <stl.h>

Public Types

using Type = V<Ts...>
using Type = V<Ts...>

Public Functions

template<typename U, typename ...Us>
inline bool load_alternative(handle src, bool convert, type_list<U, Us...>)
inline bool load_alternative(handle, bool, type_list<>)
inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (Type, _("Union[")+detail::concat(make_caster< Ts >::name...)+_("]"))
template<typename U, typename ...Us>
inline bool load_alternative(handle src, bool convert, type_list<U, Us...>)
inline bool load_alternative(handle, bool, type_list<>)
inline bool load(handle src, bool convert)
PYBIND11_TYPE_CASTER (Type, _("Union[")+detail::concat(make_caster< Ts >::name...)+_("]"))

Public Static Functions

template<typename Variant>
static inline handle cast(Variant &&src, return_value_policy policy, handle parent)
template<typename Variant>
static inline handle cast(Variant &&src, return_value_policy policy, handle parent)
struct variant_caster_visitor
#include <stl.h>

Visit a variant and cast any found type to Python.

Public Types

using result_type = handle
using result_type = handle

Public Functions

template<typename T>
inline result_type operator()(T &&src) const
template<typename T>
inline result_type operator()(T &&src) const

Public Members

return_value_policy policy
handle parent
template<typename Vector, typename = void>
struct vector_has_data_and_format : public false_type, public false_type
#include <stl_bind.h>
template<typename Vector>
struct vector_has_data_and_format<Vector, enable_if_t<std::is_same<decltype(format_descriptor<typename Vector::value_type>::format(), std::declval<Vector>().data()), typename Vector::value_type*>::value>> : public true_type, public true_type
#include <stl_bind.h>
template<typename T>
struct vectorize_arg
#include <numpy.h>

Public Types

using call_type = remove_reference_t<T>
using type = conditional_t<vectorize, array_t<remove_cv_t<call_type>, array::forcecast>, T>
using call_type = remove_reference_t<T>
using type = conditional_t<vectorize, array_t<remove_cv_t<call_type>, array::forcecast>, T>

Public Static Attributes

static constexpr bool vectorize = satisfies_any_of<call_type, std::is_arithmetic, is_complex, std::is_pod>::value && satisfies_none_of<call_type, std::is_pointer, std::is_array, is_std_array, std::is_enum>::value && (!std::is_reference<T>::value || (std::is_lvalue_reference<T>::value && std::is_const<call_type>::value))
template<typename Func, typename Return, typename ...Args>
struct vectorize_helper
#include <numpy.h>

Public Functions

template<typename T>
inline explicit vectorize_helper(T &&f)
inline object operator()(typename vectorize_arg<Args>::type... args)
template<typename T>
inline explicit vectorize_helper(T &&f)
inline object operator()(typename vectorize_arg<Args>::type... args)

Private Types

using arg_call_types = std::tuple<typename vectorize_arg<Args>::call_type...>
using param_n_t = typename std::tuple_element<Index, arg_call_types>::type
using arg_call_types = std::tuple<typename vectorize_arg<Args>::call_type...>
using param_n_t = typename std::tuple_element<Index, arg_call_types>::type

Private Functions

template<size_t... Index, size_t... VIndex, size_t... BIndex>
inline object run(typename vectorize_arg<Args>::type&... args, index_sequence<Index...> i_seq, index_sequence<VIndex...> vi_seq, index_sequence<BIndex...> bi_seq)
template<size_t... Index, size_t... VIndex, size_t... BIndex>
inline void apply_trivial(std::array<buffer_info, NVectorized> &buffers, std::array<void*, N> &params, Return *out, size_t size, index_sequence<Index...>, index_sequence<VIndex...>, index_sequence<BIndex...>)
template<size_t... Index, size_t... VIndex, size_t... BIndex>
inline void apply_broadcast(std::array<buffer_info, NVectorized> &buffers, std::array<void*, N> &params, array_t<Return> &output_array, index_sequence<Index...>, index_sequence<VIndex...>, index_sequence<BIndex...>)
template<size_t... Index, size_t... VIndex, size_t... BIndex>
inline object run(typename vectorize_arg<Args>::type&... args, index_sequence<Index...> i_seq, index_sequence<VIndex...> vi_seq, index_sequence<BIndex...> bi_seq)
template<size_t... Index, size_t... VIndex, size_t... BIndex>
inline void apply_trivial(std::array<buffer_info, NVectorized> &buffers, std::array<void*, N> &params, Return *out, size_t size, index_sequence<Index...>, index_sequence<VIndex...>, index_sequence<BIndex...>)
template<size_t... Index, size_t... VIndex, size_t... BIndex>
inline void apply_broadcast(std::array<buffer_info, NVectorized> &buffers, std::array<void*, N> &params, array_t<Return> &output_array, index_sequence<Index...>, index_sequence<VIndex...>, index_sequence<BIndex...>)

Private Members

remove_reference_t<Func> f

Private Static Attributes

static constexpr size_t N = sizeof...(Args)
static constexpr size_t NVectorized = constexpr_sum(vectorize_arg<Args>::vectorize...)
class VeryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooogName
template<template<typename...> class Variant>
struct visit_helper
#include <stl.h>

Helper class which abstracts away variant’s visit function.

std::variant and similar namespace::variant types which provide a namespace::visit() function are handled here automatically using argument-dependent lookup. Users can provide specializations for other variant-like classes, e.g. boost::variant and boost::apply_visitor.

Public Static Functions

template<typename ...Args>
static inline auto call(Args&&... args) -> decltype(visit(std::forward<Args>(args)...))
template<typename ...Args>
static inline auto call(Args&&... args) -> decltype(visit(std::forward<Args>(args)...))
template<typename T>
struct void_caster
#include <cast.h>

Public Functions

inline bool load(handle src, bool)
PYBIND11_TYPE_CASTER (T, _("None"))
inline bool load(handle src, bool)
PYBIND11_TYPE_CASTER (T, _("None"))

Public Static Functions

static inline handle cast(T, return_value_policy, handle)
static inline handle cast(T, return_value_policy, handle)
template<typename...>
struct void_t_impl
#include <common.h>

Public Types

using type = void
using type = void
struct void_type
#include <common.h>

Helper type to replace ‘void’ in some expressions.

class weakref : public object, public object
#include <pytypes.h>

Public Functions

inline explicit weakref(handle obj, handle callback = {})
inline explicit weakref(handle obj, handle callback = {})
template<typename InnerAction, size_t... I>
struct testing::internal::WithArgsAction
#include <gmock-actions.h>

Public Functions

template<typename R, typename ...Args>
inline operator Action<R(Args...)>() const
template<typename R, typename ...Args>
inline operator Action<R(Args...)>() const

Public Members

InnerAction action
template<typename T>
class testing::WithParamInterface
#include <gtest.h>

Subclassed by testing::TestWithParam< T >, testing::TestWithParam< T >

Public Types

typedef T ParamType
typedef T ParamType

Public Functions

inline virtual ~WithParamInterface()
inline virtual ~WithParamInterface()

Public Static Functions

static inline const ParamType &GetParam()
static inline const ParamType &GetParam()

Private Static Functions

static inline void SetParam(const ParamType *parameter)
static inline void SetParam(const ParamType *parameter)

Private Static Attributes

static const ParamType *parameter_ = nullptr

Friends

friend class internal::ParameterizedTestFactory
friend class internal::ParameterizedTestFactory
struct WrongTypeDebugStringMethod

Public Functions

inline std::string DebugString() const
inline int ShortDebugString() const
class testing::internal::XmlUnitTestResultPrinter : public testing::EmptyTestEventListener

Public Functions

explicit XmlUnitTestResultPrinter(const char *output_file)
virtual void OnTestIterationEnd(const UnitTest &unit_test, int iteration) override
void ListTestsMatchingFilter(const std::vector<TestSuite*> &test_suites)

Public Static Functions

static void PrintXmlTestsList(std::ostream *stream, const std::vector<TestSuite*> &test_suites)

Private Functions

GTEST_DISALLOW_COPY_AND_ASSIGN_(XmlUnitTestResultPrinter)

Private Members

const std::string output_file_

Private Static Functions

static inline bool IsNormalizableWhitespace(char c)
static inline bool IsValidXmlCharacter(char c)
static std::string EscapeXml(const std::string &str, bool is_attribute)
static std::string RemoveInvalidXmlCharacters(const std::string &str)
static inline std::string EscapeXmlAttribute(const std::string &str)
static inline std::string EscapeXmlText(const char *str)
static void OutputXmlAttribute(std::ostream *stream, const std::string &element_name, const std::string &name, const std::string &value)
static void OutputXmlCDataSection(::std::ostream *stream, const char *data)
static void OutputXmlTestSuiteForTestResult(::std::ostream *stream, const TestResult &result)
static void OutputXmlTestResult(::std::ostream *stream, const TestResult &result)
static void OutputXmlTestInfo(::std::ostream *stream, const char *test_suite_name, const TestInfo &test_info)
static void PrintXmlTestSuite(::std::ostream *stream, const TestSuite &test_suite)
static void PrintXmlUnitTest(::std::ostream *stream, const UnitTest &unit_test)
static std::string TestPropertiesAsXmlAttributes(const TestResult &result)
static void OutputXmlTestProperties(std::ostream *stream, const TestResult &result)
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace accessor_policies
namespace bar

Functions

TEST_F(MixedUpTestSuiteTest, ThisShouldFail)
TEST_F(MixedUpTestSuiteTest, ThisShouldFailToo)
TEST_F(MixedUpTestSuiteWithSameTestNameTest, TheSecondTestWithThisNameShouldFail)
namespace foo

Functions

TEST_F(MixedUpTestSuiteTest, FirstTestFromNamespaceFoo)
TEST_F(MixedUpTestSuiteTest, SecondTestFromNamespaceFoo)
TEST_F(MixedUpTestSuiteWithSameTestNameTest, TheSecondTestWithThisNameShouldFail)
void PrintTo(const PrintableViaPrintTo &x, ::std::ostream *os)
::std::ostream &operator<<(::std::ostream &os, const PointerPrintable*)
template<typename T>
void PrintTo(const PrintableViaPrintToTemplate<T> &x, ::std::ostream *os)
template<typename T>
inline ::std::ostream &operator<<(::std::ostream &os, const StreamableTemplateInFoo<T> &x)
template<typename OutputStream>
OutputStream &operator<<(OutputStream &os, const TemplatedStreamableInFoo&)
namespace library1

Typedefs

typedef Types<int, long> NumericTypes

Functions

TYPED_TEST_SUITE(NumericTest, NumericTypes)
TYPED_TEST(NumericTest, DefaultIsZero)
namespace library2

Typedefs

typedef Types<int, double> NumericTypes
typedef Types<int, double, MyPair<int, int>> TrimTypes

Functions

TYPED_TEST_SUITE_P(NumericTest)
TYPED_TEST_P(NumericTest, DefaultIsZero)
TYPED_TEST_P(NumericTest, ZeroIsLessThanOne)
REGISTER_TYPED_TEST_SUITE_P(NumericTest, DefaultIsZero, ZeroIsLessThanOne)
INSTANTIATE_TYPED_TEST_SUITE_P(My, NumericTest, NumericTypes)
static const char *GetTestName()
TYPED_TEST_SUITE_P(TrimmedTest)
TYPED_TEST_P(TrimmedTest, Test1)
TYPED_TEST_P(TrimmedTest, Test2)
TYPED_TEST_P(TrimmedTest, Test3)
TYPED_TEST_P(TrimmedTest, Test4)
TYPED_TEST_P(TrimmedTest, Test5)
REGISTER_TYPED_TEST_SUITE_P(TrimmedTest, Test1, Test2, Test3, Test4, Test5)
INSTANTIATE_TYPED_TEST_SUITE_P(My, TrimmedTest, TrimTypes)
namespace literals

Functions

constexpr arg operator""_a(const char *name, size_t)

String literal version of arg

inline str operator""_s(const char *s, size_t size)

String literal version of str

namespace my_namespace
namespace my_namespace::testing

Functions

TEST(NestedTestingNamespaceTest, Success)
TEST(NestedTestingNamespaceTest, Failure)
namespace namespace1

Functions

std::ostream &operator<<(std::ostream &os, const MyTypeInNameSpace1 &val)
std::ostream &operator<<(std::ostream &os, const MyTypeInNameSpace1 *pointer)
namespace namespace2
namespace package_template

Functions

void print_configuration(const Gains_configuration &configuration)

print values encapsulated by the provided configuration console on the standard output

PID &get_default_pid()

convenience factory for getting default controller, i.e.

same as PID(std::shared_ptr<DefaultConfiguration> configuration)

See

DefaultConfiguration

static bool get_parameter(const ros::NodeHandle &nh, const std::string &parameter, double &get_value)
namespace proto2
namespace robot_math
namespace testing

Typedefs

typedef internal::IgnoredValue Unused
typedef internal::TimeInMillis TimeInMillis

Functions

template<typename F>
Action<F> MakeAction(ActionInterface<F> *impl)
template<typename Impl>
inline PolymorphicAction<Impl> MakePolymorphicAction(const Impl &impl)
template<typename ...Action>
internal::DoAllAction<typename std::decay<Action>::type...> DoAll(Action&&... action)
template<size_t k, typename InnerAction>
internal::WithArgsAction<typename std::decay<InnerAction>::type, k> WithArg(InnerAction &&action)
template<size_t k, size_t... ks, typename InnerAction>
internal::WithArgsAction<typename std::decay<InnerAction>::type, k, ks...> WithArgs(InnerAction &&action)
template<typename InnerAction>
internal::WithArgsAction<typename std::decay<InnerAction>::type> WithoutArgs(InnerAction &&action)
template<typename R>
internal::ReturnAction<R> Return(R value)
inline PolymorphicAction<internal::ReturnNullAction> ReturnNull()
inline PolymorphicAction<internal::ReturnVoidAction> Return()
template<typename R>
inline internal::ReturnRefAction<R> ReturnRef(R &x)
template<typename R, R* = nullptr>
internal::ReturnRefAction<R> ReturnRef(R&&) = delete
template<typename R>
inline internal::ReturnRefOfCopyAction<R> ReturnRefOfCopy(const R &x)
template<typename R>
internal::ByMoveWrapper<R> ByMove(R x)
template<typename T>
internal::ReturnRoundRobinAction<T> ReturnRoundRobin(std::vector<T> vals)
template<typename T>
internal::ReturnRoundRobinAction<T> ReturnRoundRobin(std::initializer_list<T> vals)
inline internal::DoDefaultAction DoDefault()
template<size_t N, typename T>
internal::SetArgumentPointeeAction<N, T> SetArgPointee(T value)
template<size_t N, typename T>
internal::SetArgumentPointeeAction<N, T> SetArgumentPointee(T value)
template<typename T1, typename T2>
PolymorphicAction<internal::AssignAction<T1, T2>> Assign(T1 *ptr, T2 val)
template<typename T>
PolymorphicAction<internal::SetErrnoAndReturnAction<T>> SetErrnoAndReturn(int errval, T result)
template<typename FunctionImpl>
std::decay<FunctionImpl>::type Invoke(FunctionImpl &&function_impl)
template<class Class, typename MethodPtr>
internal::InvokeMethodAction<Class, MethodPtr> Invoke(Class *obj_ptr, MethodPtr method_ptr)
template<typename FunctionImpl>
internal::InvokeWithoutArgsAction<typename std::decay<FunctionImpl>::type> InvokeWithoutArgs(FunctionImpl function_impl)
template<class Class, typename MethodPtr>
internal::InvokeMethodWithoutArgsAction<Class, MethodPtr> InvokeWithoutArgs(Class *obj_ptr, MethodPtr method_ptr)
template<typename A>
inline internal::IgnoreResultAction<A> IgnoreResult(const A &an_action)
template<typename T>
inline ::std::reference_wrapper<T> ByRef(T &l_value)
template<typename T, typename ...Params>
internal::ReturnNewAction<T, typename std::decay<Params>::type...> ReturnNew(Params&&... params)
template<size_t k>
internal::ReturnArgAction<k> ReturnArg()
template<size_t k, typename Ptr>
internal::SaveArgAction<k, Ptr> SaveArg(Ptr pointer)
template<size_t k, typename Ptr>
internal::SaveArgPointeeAction<k, Ptr> SaveArgPointee(Ptr pointer)
template<size_t k, typename T>
internal::SetArgRefereeAction<k, typename std::decay<T>::type> SetArgReferee(T &&value)
template<size_t k, typename I1, typename I2>
internal::SetArrayArgumentAction<k, I1, I2> SetArrayArgument(I1 first, I2 last)
template<size_t k>
internal::DeleteArgAction<k> DeleteArg()
template<typename Ptr>
internal::ReturnPointeeAction<Ptr> ReturnPointee(Ptr pointer)
template<std::size_t index, typename ...Params>
internal::InvokeArgumentAction<index, typename std::decay<Params>::type...> InvokeArgument(Params&&... params)
MATCHER (IsEmpty, negation ? "isn't empty" :"is empty")
MATCHER (IsTrue, negation ? "is false" :"is true")
MATCHER (IsFalse, negation ? "is true" :"is false")
GMOCK_DECLARE_bool_(catch_leaked_mocks)
GMOCK_DECLARE_string_(verbose)
GMOCK_DECLARE_int32_(default_mock_behavior)
GTEST_API_ void InitGoogleMock (int *argc, char **argv)
GTEST_API_ void InitGoogleMock (int *argc, wchar_t **argv)
GTEST_API_ void InitGoogleMock ()
GTEST_DECLARE_string_(death_test_style)
inline std::ostream &operator<<(std::ostream &os, const Message &sb)
template<typename T, typename IncrementT>
internal::ParamGenerator<T> Range(T start, T end, IncrementT step)
template<typename T>
internal::ParamGenerator<T> Range(T start, T end)
template<typename ForwardIterator>
internal::ParamGenerator<typename std::iterator_traits<ForwardIterator>::value_type> ValuesIn(ForwardIterator begin, ForwardIterator end)
template<typename T, size_t N>
internal::ParamGenerator<T> ValuesIn(const T (&array)[N])
template<class Container>
internal::ParamGenerator<typename Container::value_type> ValuesIn(const Container &container)
template<typename ...T>
internal::ValueArray<T...> Values(T... v)
inline internal::ParamGenerator<bool> Bool()
template<typename ...Generator>
internal::CartesianProductHolder<Generator...> Combine(const Generator&... g)
template<typename T>
::std::string PrintToString(const T &value)
inline Environment *AddGlobalTestEnvironment(Environment *env)
GTEST_API_ void InitGoogleTest (int *argc, char **argv)
GTEST_API_ void InitGoogleTest (int *argc, wchar_t **argv)
GTEST_API_ void InitGoogleTest ()
GTEST_API_ AssertionResult IsSubstring (const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
GTEST_API_ AssertionResult IsSubstring (const char *needle_expr, const char *haystack_expr, const wchar_t *needle, const wchar_t *haystack)
GTEST_API_ AssertionResult IsNotSubstring (const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
GTEST_API_ AssertionResult IsNotSubstring (const char *needle_expr, const char *haystack_expr, const wchar_t *needle, const wchar_t *haystack)
GTEST_API_ AssertionResult IsSubstring (const char *needle_expr, const char *haystack_expr, const ::std::string &needle, const ::std::string &haystack)
GTEST_API_ AssertionResult IsNotSubstring (const char *needle_expr, const char *haystack_expr, const ::std::string &needle, const ::std::string &haystack)
GTEST_API_ AssertionResult FloatLE (const char *expr1, const char *expr2, float val1, float val2)
GTEST_API_ AssertionResult DoubleLE (const char *expr1, const char *expr2, double val1, double val2)
template<typename T1, typename T2>
constexpr bool StaticAssertTypeEq() noexcept
GTEST_API_ std::string TempDir ()
template<int&... ExplicitParameterBarrier, typename Factory>
TestInfo *RegisterTest(const char *test_suite_name, const char *test_name, const char *type_param, const char *value_param, const char *file, int line, Factory factory)
template<typename Pred, typename T1>
AssertionResult AssertPred1Helper(const char *pred_text, const char *e1, Pred pred, const T1 &v1)
template<typename Pred, typename T1, typename T2>
AssertionResult AssertPred2Helper(const char *pred_text, const char *e1, const char *e2, Pred pred, const T1 &v1, const T2 &v2)
template<typename Pred, typename T1, typename T2, typename T3>
AssertionResult AssertPred3Helper(const char *pred_text, const char *e1, const char *e2, const char *e3, Pred pred, const T1 &v1, const T2 &v2, const T3 &v3)
template<typename Pred, typename T1, typename T2, typename T3, typename T4>
AssertionResult AssertPred4Helper(const char *pred_text, const char *e1, const char *e2, const char *e3, const char *e4, Pred pred, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4)
template<typename Pred, typename T1, typename T2, typename T3, typename T4, typename T5>
AssertionResult AssertPred5Helper(const char *pred_text, const char *e1, const char *e2, const char *e3, const char *e4, const char *e5, Pred pred, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5)
GTEST_API_ Cardinality AtLeast (int n)
GTEST_API_ Cardinality AtMost (int n)
GTEST_API_ Cardinality AnyNumber ()
GTEST_API_ Cardinality Between (int min, int max)
GTEST_API_ Cardinality Exactly (int n)
GMOCK_DEFINE_bool_ (catch_leaked_mocks, true, "true if and only if Google Mock should report leaked " "mock objects as failures.")
GMOCK_DEFINE_string_ (verbose, internal::kWarningVerbosity, "Controls how verbose Google Mock's output is." "  Valid values:\ " info - prints all messages.\" " warning - prints warnings and errors.\" " error - prints errors only.")
GMOCK_DEFINE_int32_ (default_mock_behavior, 1, "Controls the default behavior of mocks." "  Valid values:\ " 0 - by default, mocks act as NiceMocks.\" " 1 - by default, mocks act as NaggyMocks.\" " 2 - by default, mocks act as StrictMocks.")
GTEST_DEFINE_string_ (death_test_style, internal::StringFromGTestEnv("death_test_style", kDefaultDeathTestStyle), "Indicates how to run a death test in a forked child process: " "\hreadsafe\(child process re-executes the test binary " "from the beginning, running only the specific death test) or " "\ast\(child process runs the death test immediately " "after forking).")
GTEST_DEFINE_bool_ (death_test_use_fork, internal::BoolFromGTestEnv("death_test_use_fork", false), "Instructs to use fork()/_exit() instead of clone() in death tests. " "Ignored and always uses fork() on POSIX systems where clone() is not " "implemented. Useful when running under valgrind or similar tools if " "those do not support clone(). Valgrind 3.3.1 will just fail if " "it sees an unsupported combination of clone() flags. " "It is not recommended to use this flag w/o valgrind though it will " "work in 99% of the cases. Once valgrind is fixed, this flag will " "most likely be removed.")
std::ostream &operator<<(std::ostream &os, const TestPartResult &result)
static const char *GetDefaultFilter()
static bool GetDefaultFailFast()
GTEST_DEFINE_bool_ (fail_fast, internal::BoolFromGTestEnv("fail_fast", GetDefaultFailFast()), "True if and only if a test failure should stop further test execution.")
GTEST_DEFINE_bool_ (also_run_disabled_tests, internal::BoolFromGTestEnv("also_run_disabled_tests", false), "Run disabled tests too, in addition to the tests normally being run.")
GTEST_DEFINE_bool_ (break_on_failure, internal::BoolFromGTestEnv("break_on_failure", false), "True if and only if a failed assertion should be a debugger " "break-point.")
GTEST_DEFINE_bool_ (catch_exceptions, internal::BoolFromGTestEnv("catch_exceptions", true), "True if and only if " GTEST_NAME_ " should catch exceptions and treat them as test failures.")
GTEST_DEFINE_string_ (color, internal::StringFromGTestEnv("color", "auto"), "Whether to use colors in the output.  Valid values: yes, no, " "and auto.  'auto' means to use colors if the output is " "being sent to a terminal and the TERM environment variable " "is set to a terminal type that supports colors.")
GTEST_DEFINE_string_ (filter, internal::StringFromGTestEnv("filter", GetDefaultFilter()), "A colon-separated list of glob (not regex) patterns " "for filtering the tests to run, optionally followed by a " "'-' and a : separated list of negative patterns (tests to " "exclude).  A test is run if it matches one of the positive " "patterns and does not match any of the negative patterns.")
GTEST_DEFINE_bool_ (install_failure_signal_handler, internal::BoolFromGTestEnv("install_failure_signal_handler", false), "If true and supported on the current platform, " GTEST_NAME_ " should " "install a signal handler that dumps debugging information when fatal " "signals are raised.")
GTEST_DEFINE_bool_ (list_tests, false, "List all tests without running them.")
GTEST_DEFINE_string_ (output, internal::StringFromGTestEnv("output", internal::OutputFlagAlsoCheckEnvVar().c_str()), "A format (defaults to \ml\but can be specified to be \son\, " "optionally followed by a colon and an output file name or directory. " "A directory is indicated by a trailing pathname separator. " "Examples: \ml:filename.xml\ \ml::directoryname/\ " "If a directory is specified, output files will be created " "within that directory, with file-names based on the test " "executable's name and, if necessary, made unique by adding " "digits.")
GTEST_DEFINE_bool_ (brief, internal::BoolFromGTestEnv("brief", false), "True if only test failures should be displayed in text output.")
GTEST_DEFINE_bool_ (print_time, internal::BoolFromGTestEnv("print_time", true), "True if and only if " GTEST_NAME_ " should display elapsed time in text output.")
GTEST_DEFINE_bool_ (print_utf8, internal::BoolFromGTestEnv("print_utf8", true), "True if and only if " GTEST_NAME_ " prints UTF8 characters as text.")
GTEST_DEFINE_int32_ (random_seed, internal::Int32FromGTestEnv("random_seed", 0), "Random number seed to use when shuffling test orders.  Must be in range " "[1, 99999], or 0 to use a seed based on the current time.")
GTEST_DEFINE_int32_ (repeat, internal::Int32FromGTestEnv("repeat", 1), "How many times to repeat each test.  Specify a negative number " "for repeating forever.  Useful for shaking out flaky tests.")
GTEST_DEFINE_bool_ (show_internal_stack_frames, false, "True if and only if " GTEST_NAME_ " should include internal stack frames when " "printing test failure stack traces.")
GTEST_DEFINE_bool_ (shuffle, internal::BoolFromGTestEnv("shuffle", false), "True if and only if " GTEST_NAME_ " should randomize tests' order on every run.")
GTEST_DEFINE_int32_ (stack_trace_depth, internal::Int32FromGTestEnv("stack_trace_depth", kMaxStackTraceDepth), "The maximum number of stack frames to print when an " "assertion fails.  The valid range is 0 through 100, inclusive.")
GTEST_DEFINE_string_ (stream_result_to, internal::StringFromGTestEnv("stream_result_to", ""), "This flag specifies the host name and the port number on which to stream " "test results. Example: \ocalhost:555\ The flag is effective only on " "Linux.")
GTEST_DEFINE_bool_ (throw_on_failure, internal::BoolFromGTestEnv("throw_on_failure", false), "When this flag is specified, a failed assertion will throw an exception " "if exceptions are enabled or exit the program with a non-zero code " "otherwise. For use with an external test framework.")
AssertionResult AssertionSuccess()
AssertionResult AssertionFailure()
AssertionResult AssertionFailure(const Message &message)
template<size_t kSize>
std::vector<std::string> ArrayAsVector(const char *const (&array)[kSize])
static std::vector<std::string> GetReservedAttributesForElement(const std::string &xml_element)
static std::vector<std::string> GetReservedOutputAttributesForElement(const std::string &xml_element)
static std::string FormatWordList(const std::vector<std::string> &words)
static bool ValidateTestPropertyName(const std::string &property_name, const std::vector<std::string> &reserved_names)
static bool TestPartSkipped(const TestPartResult &result)
static bool TestPartFatallyFailed(const TestPartResult &result)
static bool TestPartNonfatallyFailed(const TestPartResult &result)
static std::string FormatCountableNoun(int count, const char *singular_form, const char *plural_form)
static std::string FormatTestCount(int test_count)
static std::string FormatTestSuiteCount(int test_suite_count)
static const char *TestPartResultTypeToString(TestPartResult::Type type)
TEST(GTestEnvVarTest, Dummy)
void PrintFlag(const char *flag)
GTEST_DECLARE_string_(filter)
GTEST_DECLARE_int32_(repeat)
TEST(SuccessfulAssertionTest, SUCCEED)
TEST(SuccessfulAssertionTest, EXPECT)
TEST(SuccessfulAssertionTest, EXPECT_STR)
TEST(SuccessfulAssertionTest, ASSERT)
TEST(SuccessfulAssertionTest, ASSERT_STR)
TEST_F(TestInfoTest, Names)
TEST_F(TestInfoTest, result)
TEST(CodeLocationForTEST, Verify)
TEST_F(CodeLocationForTESTF, Verify)
TEST_P(CodeLocationForTESTP, Verify)
INSTANTIATE_TEST_SUITE_P (, CodeLocationForTESTP, Values(0))
TYPED_TEST_SUITE(CodeLocationForTYPEDTEST, int)
TYPED_TEST(CodeLocationForTYPEDTEST, Verify)
TYPED_TEST_SUITE_P(CodeLocationForTYPEDTESTP)
TYPED_TEST_P(CodeLocationForTYPEDTESTP, Verify)
REGISTER_TYPED_TEST_SUITE_P(CodeLocationForTYPEDTESTP, Verify)
INSTANTIATE_TYPED_TEST_SUITE_P(My, CodeLocationForTYPEDTESTP, int)
TEST_F(SetUpTestCaseTest, Test1)
TEST_F(SetUpTestCaseTest, Test2)
TEST_F(SetUpTestSuiteTest, TestSetupTestSuite1)
TEST_F(SetUpTestSuiteTest, TestSetupTestSuite2)
TEST_F(ParseFlagsTest, Empty)
TEST_F(ParseFlagsTest, NoFlag)
TEST_F(ParseFlagsTest, FailFast)
TEST_F(ParseFlagsTest, FilterBad)
TEST_F(ParseFlagsTest, FilterEmpty)
TEST_F(ParseFlagsTest, FilterNonEmpty)
TEST_F(ParseFlagsTest, BreakOnFailureWithoutValue)
TEST_F(ParseFlagsTest, BreakOnFailureFalse_0)
TEST_F(ParseFlagsTest, BreakOnFailureFalse_f)
TEST_F(ParseFlagsTest, BreakOnFailureFalse_F)
TEST_F(ParseFlagsTest, BreakOnFailureTrue)
TEST_F(ParseFlagsTest, CatchExceptions)
TEST_F(ParseFlagsTest, DeathTestUseFork)
TEST_F(ParseFlagsTest, DuplicatedFlags)
TEST_F(ParseFlagsTest, UnrecognizedFlag)
TEST_F(ParseFlagsTest, ListTestsFlag)
TEST_F(ParseFlagsTest, ListTestsTrue)
TEST_F(ParseFlagsTest, ListTestsFalse)
TEST_F(ParseFlagsTest, ListTestsFalse_f)
TEST_F(ParseFlagsTest, ListTestsFalse_F)
TEST_F(ParseFlagsTest, OutputEmpty)
TEST_F(ParseFlagsTest, OutputXml)
TEST_F(ParseFlagsTest, OutputXmlFile)
TEST_F(ParseFlagsTest, OutputXmlDirectory)
TEST_F(ParseFlagsTest, BriefFlag)
TEST_F(ParseFlagsTest, BriefFlagTrue)
TEST_F(ParseFlagsTest, BriefFlagFalse)
TEST_F(ParseFlagsTest, PrintTimeFlag)
TEST_F(ParseFlagsTest, PrintTimeTrue)
TEST_F(ParseFlagsTest, PrintTimeFalse)
TEST_F(ParseFlagsTest, PrintTimeFalse_f)
TEST_F(ParseFlagsTest, PrintTimeFalse_F)
TEST_F(ParseFlagsTest, RandomSeed)
TEST_F(ParseFlagsTest, Repeat)
TEST_F(ParseFlagsTest, AlsoRunDisabledTestsFlag)
TEST_F(ParseFlagsTest, AlsoRunDisabledTestsTrue)
TEST_F(ParseFlagsTest, AlsoRunDisabledTestsFalse)
TEST_F(ParseFlagsTest, ShuffleWithoutValue)
TEST_F(ParseFlagsTest, ShuffleFalse_0)
TEST_F(ParseFlagsTest, ShuffleTrue)
TEST_F(ParseFlagsTest, StackTraceDepth)
TEST_F(ParseFlagsTest, StreamResultTo)
TEST_F(ParseFlagsTest, ThrowOnFailureWithoutValue)
TEST_F(ParseFlagsTest, ThrowOnFailureFalse_0)
TEST_F(ParseFlagsTest, ThrowOnFailureTrue)
TEST_F(CurrentTestInfoTest, WorksForFirstTestInATestSuite)
TEST_F(CurrentTestInfoTest, WorksForSecondTestInATestSuite)

Variables

class GTEST_API_ testing::ScopedTrace GTEST_ATTRIBUTE_UNUSED_
static const char kDefaultDeathTestStyle[] = GTEST_DEFAULT_DEATH_TEST_STYLE
static const char kDisableTestFilter[] = "DISABLED_*:*/DISABLED_*"
static const char kDeathTestSuiteFilter[] = "*DeathTest:*DeathTest/*"
static const char kUniversalFilter[] = "*"
static const char kDefaultOutputFormat[] = "xml"
static const char kDefaultOutputFile[] = "test_detail"
static const char kTestShardIndex[] = "GTEST_SHARD_INDEX"
static const char kTestTotalShards[] = "GTEST_TOTAL_SHARDS"
static const char kTestShardStatusFile[] = "GTEST_SHARD_STATUS_FILE"
static const char *const kReservedTestSuitesAttributes[] = {"disabled", "errors", "failures", "name", "random_seed", "tests", "time", "timestamp"}
static const char *const kReservedTestSuiteAttributes[] = {"disabled", "errors", "failures", "name", "tests", "time", "timestamp", "skipped"}
static const char *const kReservedTestCaseAttributes[] = {"classname", "name", "status", "time", "type_param", "value_param", "file", "line"}
static const char *const kReservedOutputTestCaseAttributes[] = {"classname", "name", "status", "time", "type_param", "value_param", "file", "line", "result", "timestamp"}
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace testing::gmock_function_mocker_test

Typedefs

using FunctionMockerTestTypes = ::testing::Types<MockFoo, LegacyMockFoo>
using ExpectCallTestTypes = ::testing::Types<MockB, LegacyMockB>
using TemplateMockTestTypes = ::testing::Types<MockStack<int>, LegacyMockStack<int>>
using OverloadedMockMethodTestTypes = ::testing::Types<MockOverloadedOnArgNumber, LegacyMockOverloadedOnArgNumber>
using MockMethodMockFunctionSignatureTypes = Types<void(), int(), void(int), int(int), int(bool, int), int(bool, char, int, int, int, int, int, char, int, bool)>

Functions

TYPED_TEST_SUITE(FunctionMockerTest, FunctionMockerTestTypes)
TYPED_TEST(FunctionMockerTest, MocksVoidFunction)
TYPED_TEST(FunctionMockerTest, MocksNullaryFunction)
TYPED_TEST(FunctionMockerTest, MocksUnaryFunction)
TYPED_TEST(FunctionMockerTest, MocksBinaryFunction)
TYPED_TEST(FunctionMockerTest, MocksDecimalFunction)
TYPED_TEST(FunctionMockerTest, MocksFunctionWithNonConstReferenceArgument)
TYPED_TEST(FunctionMockerTest, MocksFunctionWithConstReferenceArgument)
TYPED_TEST(FunctionMockerTest, MocksFunctionWithConstArgument)
TYPED_TEST(FunctionMockerTest, MocksFunctionsOverloadedOnArgumentNumber)
TYPED_TEST(FunctionMockerTest, MocksFunctionsOverloadedOnArgumentType)
TYPED_TEST(FunctionMockerTest, MocksFunctionsOverloadedOnConstnessOfThis)
TYPED_TEST(FunctionMockerTest, MocksReturnTypeWithComma)
TYPED_TEST(FunctionMockerTest, MocksTypeWithTemplatedCopyCtor)
TEST(FunctionMockerTest, RefQualified)
TYPED_TEST_SUITE(ExpectCallTest, ExpectCallTestTypes)
TYPED_TEST(ExpectCallTest, UnmentionedFunctionCanBeCalledAnyNumberOfTimes)
TYPED_TEST_SUITE(TemplateMockTest, TemplateMockTestTypes)
TYPED_TEST(TemplateMockTest, Works)
TYPED_TEST(TemplateMockTest, MethodWithCommaInReturnTypeWorks)
TYPED_TEST_SUITE(OverloadedMockMethodTest, OverloadedMockMethodTestTypes)
TYPED_TEST(OverloadedMockMethodTest, CanOverloadOnArgNumberInMacroBody)
TEST(MockMethodOverloadedMockMethodTest, CanOverloadOnConstnessInMacroBody)
TEST(MockMethodMockFunctionTest, WorksForVoidNullary)
TEST(MockMethodMockFunctionTest, WorksForNonVoidNullary)
TEST(MockMethodMockFunctionTest, WorksForVoidUnary)
TEST(MockMethodMockFunctionTest, WorksForNonVoidBinary)
TEST(MockMethodMockFunctionTest, WorksFor10Arguments)
TEST(MockMethodMockFunctionTest, AsStdFunction)
TEST(MockMethodMockFunctionTest, AsStdFunctionReturnsReference)
TEST(MockMethodMockFunctionTest, AsStdFunctionWithReferenceParameter)
TYPED_TEST_SUITE(MockMethodMockFunctionSignatureTest, MockMethodMockFunctionSignatureTypes)
TYPED_TEST(MockMethodMockFunctionSignatureTest, IsMockFunctionTemplateArgumentDeducedForRawSignature)
TYPED_TEST(MockMethodMockFunctionSignatureTest, IsMockFunctionTemplateArgumentDeducedForStdFunction)
TYPED_TEST(MockMethodMockFunctionSignatureTest, IsMockFunctionCallMethodSignatureTheSameForRawSignatureAndStdFunction)
TYPED_TEST(MockMethodMockFunctionSignatureTest, IsMockFunctionAsStdFunctionMethodSignatureTheSameForRawSignatureAndStdFunction)
TEST(MockMethodMockFunctionTest, MockMethodSizeOverhead)
void hasTwoParams(int, int)
void MaybeThrows()
void DoesntThrow() noexcept
TEST(MockMethodMockFunctionTest, NoexceptSpecifierPreserved)
namespace [anonymous]
namespace gmock_matchers_test
namespace [anonymous]
namespace adl_test
namespace convertible_from_any
namespace matcher_test
namespace testing::gmock_more_actions_test

Functions

inline short Short(short n)
inline char Char(char ch)
int Nullary()
bool Unary(int x)
bool ByConstRef(const std::string &s)
bool ReferencesGlobalDouble(const double &x)
const char *Binary(const char *input, short n)
int Ternary(int x, char y, short z)
int SumOf4(int a, int b, int c, int d)
int SumOfFirst2(int a, int b, Unused, Unused)
int SumOf5(int a, int b, int c, int d, int e)
int SumOf6(int a, int b, int c, int d, int e, int f)
std::string Concat7(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7)
std::string Concat8(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8)
std::string Concat9(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8, const char *s9)
std::string Concat10(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8, const char *s9, const char *s10)
TEST(InvokeTest, Nullary)
TEST(InvokeTest, Unary)
TEST(InvokeTest, Binary)
TEST(InvokeTest, Ternary)
TEST(InvokeTest, FunctionThatTakes4Arguments)
TEST(InvokeTest, FunctionThatTakes5Arguments)
TEST(InvokeTest, FunctionThatTakes6Arguments)
inline const char *CharPtr(const char *s)
TEST(InvokeTest, FunctionThatTakes7Arguments)
TEST(InvokeTest, FunctionThatTakes8Arguments)
TEST(InvokeTest, FunctionThatTakes9Arguments)
TEST(InvokeTest, FunctionThatTakes10Arguments)
TEST(InvokeTest, FunctionWithUnusedParameters)
TEST(InvokeTest, MethodWithUnusedParameters)
TEST(InvokeTest, Functor)
TEST(InvokeTest, FunctionWithCompatibleType)
TEST(InvokeMethodTest, Nullary)
TEST(InvokeMethodTest, Unary)
TEST(InvokeMethodTest, Binary)
TEST(InvokeMethodTest, Ternary)
TEST(InvokeMethodTest, MethodThatTakes4Arguments)
TEST(InvokeMethodTest, MethodThatTakes5Arguments)
TEST(InvokeMethodTest, MethodThatTakes6Arguments)
TEST(InvokeMethodTest, MethodThatTakes7Arguments)
TEST(InvokeMethodTest, MethodThatTakes8Arguments)
TEST(InvokeMethodTest, MethodThatTakes9Arguments)
TEST(InvokeMethodTest, MethodThatTakes10Arguments)
TEST(InvokeMethodTest, MethodWithCompatibleType)
TEST(WithoutArgsTest, NoArg)
TEST(WithArgTest, OneArg)
TEST(ReturnArgActionTest, WorksForOneArgIntArg0)
TEST(ReturnArgActionTest, WorksForMultiArgBoolArg0)
TEST(ReturnArgActionTest, WorksForMultiArgStringArg2)
TEST(SaveArgActionTest, WorksForSameType)
TEST(SaveArgActionTest, WorksForCompatibleType)
TEST(SaveArgPointeeActionTest, WorksForSameType)
TEST(SaveArgPointeeActionTest, WorksForCompatibleType)
TEST(SetArgRefereeActionTest, WorksForSameType)
TEST(SetArgRefereeActionTest, WorksForCompatibleType)
TEST(SetArgRefereeActionTest, WorksWithExtraArguments)
TEST(DeleteArgActionTest, OneArg)
TEST(DeleteArgActionTest, TenArgs)
TEST(SetArrayArgumentTest, SetsTheNthArray)
TEST(SetArrayArgumentTest, SetsTheNthArrayWithEmptyRange)
TEST(SetArrayArgumentTest, SetsTheNthArrayWithConvertibleType)
TEST(SetArrayArgumentTest, SetsTheNthArrayWithIteratorArgument)
TEST(ReturnPointeeTest, Works)
TEST(InvokeArgumentTest, Function0)
TEST(InvokeArgumentTest, Functor1)
TEST(InvokeArgumentTest, Function5)
TEST(InvokeArgumentTest, Functor5)
TEST(InvokeArgumentTest, Function6)
TEST(InvokeArgumentTest, Functor6)
TEST(InvokeArgumentTest, Function7)
TEST(InvokeArgumentTest, Function8)
TEST(InvokeArgumentTest, Function9)
TEST(InvokeArgumentTest, Function10)
TEST(InvokeArgumentTest, ByPointerFunction)
TEST(InvokeArgumentTest, FunctionWithCStringLiteral)
TEST(InvokeArgumentTest, ByConstReferenceFunction)
TEST(InvokeArgumentTest, ByExplicitConstReferenceFunction)
TEST(DoAllTest, TwoActions)
TEST(DoAllTest, ThreeActions)
TEST(DoAllTest, FourActions)
TEST(DoAllTest, FiveActions)
TEST(DoAllTest, SixActions)
TEST(DoAllTest, SevenActions)
TEST(DoAllTest, EightActions)
TEST(DoAllTest, NineActions)
TEST(DoAllTest, TenActions)
TEST(DoAllTest, NoArgs)
TEST(DoAllTest, MoveOnlyArgs)
TEST(DoAllTest, ImplicitlyConvertsActionArguments)
ACTION(Return5)
TEST(ActionMacroTest, WorksWhenNotReferencingArguments)
ACTION(IncrementArg1)
TEST(ActionMacroTest, WorksWhenReturningVoid)
ACTION(IncrementArg2)
TEST(ActionMacroTest, CanReferenceArgumentType)
ACTION(Sum2)
TEST(ActionMacroTest, CanReferenceArgumentTuple)
ACTION(InvokeDummy)
TEST(ActionMacroTest, CanReferenceMockFunctionType)
ACTION(InvokeDummy2)
TEST(ActionMacroTest, CanReferenceMockFunctionReturnType)
ACTION(ReturnAddrOfConstBoolReferenceArg)
TEST(ActionMacroTest, WorksForConstReferenceArg)
ACTION(ReturnAddrOfIntReferenceArg)
TEST(ActionMacroTest, WorksForNonConstReferenceArg)
TEST(ActionMacroTest, WorksInNamespace)
ACTION(PlusTwo)
TEST(ActionMacroTest, WorksForDifferentArgumentNumbers)
ACTION_P(Plus, n)
TEST(ActionPMacroTest, DefinesParameterizedAction)
ACTION_P(TypedPlus, n)
TEST(ActionPMacroTest, CanReferenceArgumentAndParameterTypes)
TEST(ActionPMacroTest, WorksInCompatibleMockFunction)
ACTION(OverloadedAction)
ACTION_P(OverloadedAction, default_value)
ACTION_P2(OverloadedAction, true_value, false_value)
TEST(ActionMacroTest, CanDefineOverloadedActions)
ACTION_P3(Plus, m, n, k)
TEST(ActionPnMacroTest, WorksFor3Parameters)
ACTION_P4(Plus, p0, p1, p2, p3)
TEST(ActionPnMacroTest, WorksFor4Parameters)
ACTION_P5(Plus, p0, p1, p2, p3, p4)
TEST(ActionPnMacroTest, WorksFor5Parameters)
ACTION_P6(Plus, p0, p1, p2, p3, p4, p5)
TEST(ActionPnMacroTest, WorksFor6Parameters)
ACTION_P7(Plus, p0, p1, p2, p3, p4, p5, p6)
TEST(ActionPnMacroTest, WorksFor7Parameters)
ACTION_P8(Plus, p0, p1, p2, p3, p4, p5, p6, p7)
TEST(ActionPnMacroTest, WorksFor8Parameters)
ACTION_P9(Plus, p0, p1, p2, p3, p4, p5, p6, p7, p8)
TEST(ActionPnMacroTest, WorksFor9Parameters)
ACTION_P10(Plus, p0, p1, p2, p3, p4, p5, p6, p7, p8, last_param)
TEST(ActionPnMacroTest, WorksFor10Parameters)
ACTION_P2(PadArgument, prefix, suffix)
TEST(ActionPnMacroTest, SimpleTypePromotion)
ACTION_P3(ConcatImpl, a, b, c)
template<typename T1, typename T2>
ConcatImplActionP3<std::string, T1, T2> Concat(const std::string &a, T1 b, T2 c)
template<typename T1, typename T2>
ConcatImplActionP3<T1, int, T2> Concat(T1 a, int b, T2 c)
TEST(ActionPnMacroTest, CanPartiallyRestrictParameterTypes)
ACTION(DoFoo)
ACTION_P(DoFoo, p)
ACTION_P2(DoFoo, p0, p1)
TEST(ActionPnMacroTest, TypesAreCorrect)
ACTION_P(Plus1, x)
ACTION_P2(Plus2, x, y)
ACTION_P3(Plus3, x, y, z)
ACTION_P10(Plus10, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)
TEST(ActionPnMacroTest, CanExplicitlyInstantiateWithReferenceTypes)
ACTION_TEMPLATE (CreateNew, HAS_1_TEMPLATE_PARAMS(typename, T), AND_0_VALUE_PARAMS())
TEST(ActionTemplateTest, WorksWithoutValueParam)
ACTION_TEMPLATE (CreateNew, HAS_1_TEMPLATE_PARAMS(typename, T), AND_1_VALUE_PARAMS(a0))
TEST(ActionTemplateTest, WorksWithValueParams)
ACTION_TEMPLATE(MyDeleteArg, HAS_1_TEMPLATE_PARAMS(int, k), AND_0_VALUE_PARAMS())
TEST(ActionTemplateTest, WorksForIntegralTemplateParams)
ACTION_TEMPLATE (ReturnSmartPointer, HAS_1_TEMPLATE_PARAMS(template< typename Pointee > class, Pointer), AND_1_VALUE_PARAMS(pointee))
TEST(ActionTemplateTest, WorksForTemplateTemplateParameters)
ACTION_TEMPLATE (ReturnGiant, HAS_10_TEMPLATE_PARAMS(typename, T1, typename, T2, typename, T3, int, k4, bool, k5, unsigned int, k6, class, T7, class, T8, class, T9, template< typename T > class, T10), AND_1_VALUE_PARAMS(value))
TEST(ActionTemplateTest, WorksFor10TemplateParameters)
ACTION_TEMPLATE (ReturnSum, HAS_1_TEMPLATE_PARAMS(typename, Number), AND_10_VALUE_PARAMS(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10))
TEST(ActionTemplateTest, WorksFor10ValueParameters)
ACTION(ReturnSum)
ACTION_P(ReturnSum, x)
ACTION_TEMPLATE (ReturnSum, HAS_1_TEMPLATE_PARAMS(typename, Number), AND_2_VALUE_PARAMS(v1, v2))
ACTION_TEMPLATE (ReturnSum, HAS_1_TEMPLATE_PARAMS(typename, Number), AND_3_VALUE_PARAMS(v1, v2, v3))
ACTION_TEMPLATE (ReturnSum, HAS_2_TEMPLATE_PARAMS(typename, Number, int, k), AND_4_VALUE_PARAMS(v1, v2, v3, v4))
TEST(ActionTemplateTest, CanBeOverloadedOnNumberOfValueParameters)

Variables

bool g_done = false
const double g_double = 0
namespace [anonymous]
namespace testing::gmock_more_actions_test::action_test

Functions

ACTION(Sum)
namespace testing::gmock_nice_strict_test

Functions

TEST(NiceMockTest, AllowsExpectedCall)
TEST(NiceMockTest, ThrowsExceptionForUnknownReturnTypes)
TEST(NiceMockTest, UnexpectedCallFails)
TEST(NiceMockTest, NonDefaultConstructor)
TEST(NiceMockTest, NonDefaultConstructor10)
TEST(NiceMockTest, AllowLeak)
TEST(NiceMockTest, MoveOnlyConstructor)
TEST(NiceMockTest, AcceptsClassNamedMock)
TEST(NiceMockTest, IsNiceInDestructor)
TEST(NiceMockTest, IsNaggy_IsNice_IsStrict)
TEST(NaggyMockTest, AllowsExpectedCall)
TEST(NaggyMockTest, UnexpectedCallFails)
TEST(NaggyMockTest, NonDefaultConstructor)
TEST(NaggyMockTest, NonDefaultConstructor10)
TEST(NaggyMockTest, AllowLeak)
TEST(NaggyMockTest, MoveOnlyConstructor)
TEST(NaggyMockTest, AcceptsClassNamedMock)
TEST(NaggyMockTest, IsNaggyInDestructor)
TEST(NaggyMockTest, IsNaggy_IsNice_IsStrict)
TEST(StrictMockTest, AllowsExpectedCall)
TEST(StrictMockTest, UnexpectedCallFails)
TEST(StrictMockTest, UninterestingCallFails)
TEST(StrictMockTest, UninterestingCallFailsAfterDeath)
TEST(StrictMockTest, NonDefaultConstructor)
TEST(StrictMockTest, NonDefaultConstructor10)
TEST(StrictMockTest, AllowLeak)
TEST(StrictMockTest, MoveOnlyConstructor)
TEST(StrictMockTest, AcceptsClassNamedMock)
TEST(StrictMockTest, IsStrictInDestructor)
TEST(StrictMockTest, IsNaggy_IsNice_IsStrict)
namespace testing::gtest_printers_test

Functions

template<typename T>
std::string Print(const T &value)
template<typename T>
std::string PrintByRef(const T &value)
TEST(PrintEnumTest, AnonymousEnum)
TEST(PrintEnumTest, EnumWithoutPrinter)
TEST(PrintEnumTest, EnumWithStreaming)
TEST(PrintEnumTest, EnumWithPrintTo)
TEST(PrintClassTest, BiggestIntConvertible)
TEST(PrintCharTest, PlainChar)
TEST(PrintCharTest, SignedChar)
TEST(PrintCharTest, UnsignedChar)
TEST(PrintCharTest, Char16)
TEST(PrintCharTest, Char32)
TEST(PrintBuiltInTypeTest, Bool)
TEST(PrintBuiltInTypeTest, Wchar_t)
TEST(PrintTypeSizeTest, Wchar_t)
TEST(PrintBuiltInTypeTest, Integer)
TEST(PrintBuiltInTypeTest, Size_t)
TEST(PrintBuiltInTypeTest, FloatingPoints)
static std::string PrintPointer(const void *p)
TEST(PrintCStringTest, Const)
TEST(PrintCStringTest, NonConst)
TEST(PrintCStringTest, Null)
TEST(PrintCStringTest, EscapesProperly)
TEST(PrintU16StringTest, Const)
TEST(PrintU16StringTest, NonConst)
TEST(PrintU16StringTest, Null)
TEST(PrintU16StringTest, EscapesProperly)
TEST(PrintU32StringTest, Const)
TEST(PrintU32StringTest, NonConst)
TEST(PrintU32StringTest, Null)
TEST(PrintU32StringTest, EscapesProperly)
TEST(PrintWideCStringTest, Const)
TEST(PrintWideCStringTest, NonConst)
TEST(PrintWideCStringTest, Null)
TEST(PrintWideCStringTest, EscapesProperly)
TEST(PrintCharPointerTest, SignedChar)
TEST(PrintCharPointerTest, ConstSignedChar)
TEST(PrintCharPointerTest, UnsignedChar)
TEST(PrintCharPointerTest, ConstUnsignedChar)
TEST(PrintPointerToBuiltInTypeTest, Bool)
TEST(PrintPointerToBuiltInTypeTest, Void)
TEST(PrintPointerToBuiltInTypeTest, ConstVoid)
TEST(PrintPointerToPointerTest, IntPointerPointer)
void MyFunction(int)
TEST(PrintPointerTest, NonMemberFunctionPointer)
template<typename StringType>
AssertionResult HasPrefix(const StringType &str, const StringType &prefix)
TEST(PrintPointerTest, MemberVariablePointer)
TEST(PrintPointerTest, MemberFunctionPointer)
template<typename T, size_t N>
std::string PrintArrayHelper(T (&a)[N])
TEST(PrintArrayTest, OneDimensionalArray)
TEST(PrintArrayTest, TwoDimensionalArray)
TEST(PrintArrayTest, ConstArray)
TEST(PrintArrayTest, CharArrayWithNoTerminatingNul)
TEST(PrintArrayTest, CharArrayWithTerminatingNul)
TEST(PrintArrayTest, Char16ArrayWithNoTerminatingNul)
TEST(PrintArrayTest, Char16ArrayWithTerminatingNul)
TEST(PrintArrayTest, Char32ArrayWithNoTerminatingNul)
TEST(PrintArrayTest, Char32ArrayWithTerminatingNul)
TEST(PrintArrayTest, WCharArrayWithNoTerminatingNul)
TEST(PrintArrayTest, WCharArrayWithTerminatingNul)
TEST(PrintArrayTest, ObjectArray)
TEST(PrintArrayTest, BigArray)
TEST(PrintStringTest, StringInStdNamespace)
TEST(PrintStringTest, StringAmbiguousHex)
TEST(PrintStringTest, U16String)
TEST(PrintStringTest, U32String)
template<typename Char, typename CharTraits>
std::basic_ostream<Char, CharTraits> &operator<<(std::basic_ostream<Char, CharTraits> &os, const AllowsGenericStreaming&)
TEST(PrintTypeWithGenericStreamingTest, NonTemplateType)
template<typename Char, typename CharTraits, typename T>
std::basic_ostream<Char, CharTraits> &operator<<(std::basic_ostream<Char, CharTraits> &os, const AllowsGenericStreamingTemplate<T>&)
TEST(PrintTypeWithGenericStreamingTest, TemplateType)
template<typename Char, typename CharTraits, typename T>
std::basic_ostream<Char, CharTraits> &operator<<(std::basic_ostream<Char, CharTraits> &os, const AllowsGenericStreamingAndImplicitConversionTemplate<T>&)
TEST(PrintTypeWithGenericStreamingTest, TypeImplicitlyConvertible)
TEST(PrintStlContainerTest, EmptyDeque)
TEST(PrintStlContainerTest, NonEmptyDeque)
TEST(PrintStlContainerTest, OneElementHashMap)
TEST(PrintStlContainerTest, HashMultiMap)
TEST(PrintStlContainerTest, HashSet)
TEST(PrintStlContainerTest, HashMultiSet)
TEST(PrintStlContainerTest, List)
TEST(PrintStlContainerTest, Map)
TEST(PrintStlContainerTest, MultiMap)
TEST(PrintStlContainerTest, Set)
TEST(PrintStlContainerTest, MultiSet)
TEST(PrintStlContainerTest, SinglyLinkedList)
TEST(PrintStlContainerTest, Pair)
TEST(PrintStlContainerTest, Vector)
TEST(PrintStlContainerTest, LongSequence)
TEST(PrintStlContainerTest, NestedContainer)
TEST(PrintStlContainerTest, OneDimensionalNativeArray)
TEST(PrintStlContainerTest, TwoDimensionalNativeArray)
TEST(PrintStlContainerTest, Iterator)
TEST(PrintStlContainerTest, ConstIterator)
TEST(PrintStdTupleTest, VariousSizes)
TEST(PrintStdTupleTest, NestedTuple)
TEST(PrintNullptrT, Basic)
TEST(PrintReferenceWrapper, Printable)
TEST(PrintReferenceWrapper, Unprintable)
TEST(PrintUnprintableTypeTest, InGlobalNamespace)
TEST(PrintUnprintableTypeTest, InUserNamespace)
TEST(PrintUnpritableTypeTest, BigObject)
TEST(PrintStreamableTypeTest, InGlobalNamespace)
TEST(PrintStreamableTypeTest, TemplateTypeInUserNamespace)
TEST(PrintStreamableTypeTest, TypeInUserNamespaceWithTemplatedStreamOperator)
TEST(PrintStreamableTypeTest, SubclassUsesSuperclassStreamOperator)
TEST(PrintStreamableTypeTest, PathLikeInUserNamespace)
TEST(PrintPrintableTypeTest, InUserNamespace)
TEST(PrintPrintableTypeTest, PointerInUserNamespace)
TEST(PrintPrintableTypeTest, TemplateInUserNamespace)
TEST(PrintReferenceTest, PrintsAddressAndValue)
TEST(PrintReferenceTest, HandlesFunctionPointer)
TEST(PrintReferenceTest, HandlesMemberFunctionPointer)
TEST(PrintReferenceTest, HandlesMemberVariablePointer)
TEST(FormatForComparisonFailureMessageTest, WorksForScalar)
TEST(FormatForComparisonFailureMessageTest, WorksForNonCharPointer)
TEST(FormatForComparisonFailureMessageTest, FormatsNonCharArrayAsPointer)
TEST(FormatForComparisonFailureMessageTest, WorksForCharPointerVsPointer)
TEST(FormatForComparisonFailureMessageTest, WorksForWCharPointerVsPointer)
TEST(FormatForComparisonFailureMessageTest, WorksForCharPointerVsStdString)
TEST(FormatForComparisonFailureMessageTest, WorksForCharArrayVsPointer)
TEST(FormatForComparisonFailureMessageTest, WorksForCharArrayVsCharArray)
TEST(FormatForComparisonFailureMessageTest, WorksForWCharArrayVsPointer)
TEST(FormatForComparisonFailureMessageTest, WorksForWCharArrayVsWCharArray)
TEST(FormatForComparisonFailureMessageTest, WorksForCharArrayVsStdString)
TEST(PrintToStringTest, WorksForScalar)
TEST(PrintToStringTest, WorksForPointerToConstChar)
TEST(PrintToStringTest, WorksForPointerToNonConstChar)
TEST(PrintToStringTest, EscapesForPointerToConstChar)
TEST(PrintToStringTest, EscapesForPointerToNonConstChar)
TEST(PrintToStringTest, WorksForArray)
TEST(PrintToStringTest, WorksForCharArray)
TEST(PrintToStringTest, WorksForCharArrayWithEmbeddedNul)
TEST(PrintToStringTest, ContainsNonLatin)
TEST(IsValidUTF8Test, IllFormedUTF8)
TEST(UniversalTersePrintTest, WorksForNonReference)
TEST(UniversalTersePrintTest, WorksForReference)
TEST(UniversalTersePrintTest, WorksForCString)
TEST(UniversalPrintTest, WorksForNonReference)
TEST(UniversalPrintTest, WorksForReference)
TEST(UniversalPrintTest, WorksForPairWithConst)
TEST(UniversalPrintTest, WorksForCString)
TEST(UniversalPrintTest, WorksForCharArray)
TEST(UniversalPrintTest, IncompleteType)
TEST(UniversalPrintTest, SmartPointers)
TEST(UniversalTersePrintTupleFieldsToStringsTestWithStd, PrintsEmptyTuple)
TEST(UniversalTersePrintTupleFieldsToStringsTestWithStd, PrintsOneTuple)
TEST(UniversalTersePrintTupleFieldsToStringsTestWithStd, PrintsTwoTuple)
TEST(UniversalTersePrintTupleFieldsToStringsTestWithStd, PrintsTersely)
namespace [anonymous]
namespace testing::internal

Typedefs

using disjunction = typename ::std::conditional<P::value, P, Q>::type
using identity_t = T
typedef ::std::vector<::std::string> Strings

Enums

enum CharFormat

Values:

enumerator kAsIs
enumerator kHexEscape
enumerator kSpecialEscape

Functions

GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ (void,)
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ (::std::string, "")
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ (bool, false)
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ (unsigned char, '\0')
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ (signed char, '\0')
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ (char, '\0')
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ (unsigned short, 0U)
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ (signed short, 0)
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ (unsigned long, 0UL)
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ (signed long, 0L)
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ (unsigned long long, 0)
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ (signed long long, 0)
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ (float, 0)
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ (double, 0)
template<typename F, typename Impl>
::testing::Action<F> MakeAction()
template<typename F, typename Impl>
::testing::Action<F> MakeAction(std::shared_ptr<Impl> impl)
template<typename F, typename ...Args>
auto InvokeArgument(F f, Args... args) -> decltype(f(args...))
template<typename T>
std::true_type StrictnessModifierProbe(const NiceMock<T>&)
template<typename T>
std::true_type StrictnessModifierProbe(const NaggyMock<T>&)
template<typename T>
std::true_type StrictnessModifierProbe(const StrictMock<T>&)
std::false_type StrictnessModifierProbe(...)
template<typename T>
constexpr bool HasStrictnessModifier()
template<typename T>
std::string StreamableToString(const T &streamable)
template<typename T>
void UniversalPrint(const T &value, ::std::ostream *os)
GTEST_API_ void PrintBytesInObjectTo (const unsigned char *obj_bytes, size_t count, ::std::ostream *os)
template<typename T>
void PrintWithFallback(const T &value, ::std::ostream *os)
GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char)
GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t)
GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char16_t)
GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char32_t)
GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string)
GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char16_t, ::std::u16string)
GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char32_t, ::std::u32string)
template<typename T1, typename T2>
std::string FormatForComparisonFailureMessage(const T1 &value, const T2&)
template<typename T>
void PrintTo(const T &value, ::std::ostream *os)
GTEST_API_ void PrintTo (unsigned char c, ::std::ostream *os)
GTEST_API_ void PrintTo (signed char c, ::std::ostream *os)
inline void PrintTo(char c, ::std::ostream *os)
inline void PrintTo(bool x, ::std::ostream *os)
GTEST_API_ void PrintTo (wchar_t wc, ::std::ostream *os)
GTEST_API_ void PrintTo (char32_t c, ::std::ostream *os)
inline void PrintTo(char16_t c, ::std::ostream *os)
GTEST_API_ void PrintTo (const char *s, ::std::ostream *os)
inline void PrintTo(char *s, ::std::ostream *os)
inline void PrintTo(const signed char *s, ::std::ostream *os)
inline void PrintTo(signed char *s, ::std::ostream *os)
inline void PrintTo(const unsigned char *s, ::std::ostream *os)
inline void PrintTo(unsigned char *s, ::std::ostream *os)
void PrintTo(const char16_t *s, ::std::ostream *os)
inline void PrintTo(char16_t *s, ::std::ostream *os)
void PrintTo(const char32_t *s, ::std::ostream *os)
inline void PrintTo(char32_t *s, ::std::ostream *os)
GTEST_API_ void PrintTo (const wchar_t *s, ::std::ostream *os)
inline void PrintTo(wchar_t *s, ::std::ostream *os)
template<typename T>
void PrintRawArrayTo(const T a[], size_t count, ::std::ostream *os)
GTEST_API_ void PrintStringTo (const ::std::string &s, ::std::ostream *os)
inline void PrintTo(const ::std::string &s, ::std::ostream *os)
GTEST_API_ void PrintU16StringTo (const ::std::u16string &s, ::std::ostream *os)
inline void PrintTo(const ::std::u16string &s, ::std::ostream *os)
GTEST_API_ void PrintU32StringTo (const ::std::u32string &s, ::std::ostream *os)
inline void PrintTo(const ::std::u32string &s, ::std::ostream *os)
inline void PrintTo(std::nullptr_t, ::std::ostream *os)
template<typename T>
void PrintTo(std::reference_wrapper<T> ref, ::std::ostream *os)
inline const void *VoidifyPointer(const void *p)
inline const void *VoidifyPointer(volatile const void *p)
template<typename T, typename Ptr>
void PrintSmartPointer(const Ptr &ptr, std::ostream *os, char)
template<typename T, typename Ptr, typename = typename std::enable_if<!std::is_void<T>::value && !std::is_array<T>::value>::type>
void PrintSmartPointer(const Ptr &ptr, std::ostream *os, int)
template<typename T, typename D>
void PrintTo(const std::unique_ptr<T, D> &ptr, std::ostream *os)
template<typename T>
void PrintTo(const std::shared_ptr<T> &ptr, std::ostream *os)
template<typename T>
void PrintTupleTo(const T&, std::integral_constant<size_t, 0>, ::std::ostream*)
template<typename T, size_t I>
void PrintTupleTo(const T &t, std::integral_constant<size_t, I>, ::std::ostream *os)
template<typename ...Types>
void PrintTo(const ::std::tuple<Types...> &t, ::std::ostream *os)
template<typename T1, typename T2>
void PrintTo(const ::std::pair<T1, T2> &value, ::std::ostream *os)
template<typename T>
void UniversalPrintArray(const T *begin, size_t len, ::std::ostream *os)
GTEST_API_ void UniversalPrintArray (const char *begin, size_t len, ::std::ostream *os)
GTEST_API_ void UniversalPrintArray (const char16_t *begin, size_t len, ::std::ostream *os)
GTEST_API_ void UniversalPrintArray (const char32_t *begin, size_t len, ::std::ostream *os)
GTEST_API_ void UniversalPrintArray (const wchar_t *begin, size_t len, ::std::ostream *os)
template<typename T>
void UniversalTersePrint(const T &value, ::std::ostream *os)
template<typename Tuple>
void TersePrintPrefixToStrings(const Tuple&, std::integral_constant<size_t, 0>, Strings*)
template<typename Tuple, size_t I>
void TersePrintPrefixToStrings(const Tuple &t, std::integral_constant<size_t, I>, Strings *strings)
template<typename Tuple>
Strings UniversalTersePrintTupleFieldsToStrings(const Tuple &value)
template<typename T1, typename T2>
AssertionResult CmpHelperEQFailure(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
inline bool operator==(faketype, faketype)
inline bool operator!=(faketype, faketype)
template<typename T1, typename T2>
AssertionResult CmpHelperEQ(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
template<typename T1, typename T2>
AssertionResult CmpHelperOpFailure(const char *expr1, const char *expr2, const T1 &val1, const T2 &val2, const char *op)
GTEST_API_ AssertionResult CmpHelperSTREQ (const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
GTEST_API_ AssertionResult CmpHelperSTRCASEEQ (const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
GTEST_API_ AssertionResult CmpHelperSTRNE (const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
GTEST_API_ AssertionResult CmpHelperSTRCASENE (const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
GTEST_API_ AssertionResult CmpHelperSTREQ (const char *s1_expression, const char *s2_expression, const wchar_t *s1, const wchar_t *s2)
GTEST_API_ AssertionResult CmpHelperSTRNE (const char *s1_expression, const char *s2_expression, const wchar_t *s1, const wchar_t *s2)
template<typename RawType>
AssertionResult CmpHelperFloatingPointEQ(const char *lhs_expression, const char *rhs_expression, RawType lhs_value, RawType rhs_value)
GTEST_API_ AssertionResult DoubleNearPredFormat (const char *expr1, const char *expr2, const char *abs_error_expr, double val1, double val2, double abs_error)
GTEST_API_ std::string JoinAsTuple (const Strings &fields)
GTEST_API_ std::string ConvertIdentifierNameToWords (const char *id_name)
GTEST_API_ FailureReporterInterface * GetFailureReporter ()
static static GTEST_DEFINE_STATIC_MUTEX_ (g_log_mutex)
GTEST_API_ bool LogIsVisible (LogSeverity severity)
GTEST_API_ void Log (LogSeverity severity, const std::string &message, int stack_frames_to_skip)
GTEST_API_ WithoutMatchers GetWithoutMatchers ()
GTEST_API_ void IllegalDoDefault (const char *file, int line)
GTEST_API_ std::string FormatMatcherDescription (bool negation, const char *matcher_name, const Strings &param_values)
GTEST_API_ ElementMatcherPairs FindMaxBipartiteMatching (const MatchMatrix &g)
static void LogElementMatcherPairVec(const ElementMatcherPairs &pairs, ::std::ostream *stream)
GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_gmock_mutex)
GTEST_API_ void LogWithLocation (testing::internal::LogSeverity severity, const char *file, int line, const std::string &message)
void ReportUninterestingCall(CallReaction reaction, const std::string &msg)
CallReaction intToCallReaction(int mock_behavior)
static const char *ParseGoogleMockFlagValue(const char *str, const char *flag, bool def_optional)
static bool ParseGoogleMockBoolFlag(const char *str, const char *flag, bool *value)
template<typename String>
static bool ParseGoogleMockStringFlag(const char *str, const char *flag, String *value)
static bool ParseGoogleMockIntFlag(const char *str, const char *flag, int32_t *value)
template<typename CharType>
void InitGoogleMockImpl(int *argc, CharType **argv)
GTEST_DEFINE_string_ (internal_run_death_test, "", "Indicates the file, line number, temporal index of " "the single death test to run, and a file descriptor to " "which a success code may be sent, all separated by " "the '|' characters.  This flag is specified if and only if the " "current process is a sub-process launched for running a thread-safe " "death test.  FOR INTERNAL USE ONLY.")
static bool IsPathSeparator(char c)
size_t GetThreadCount()
GTEST_API_::std::string FormatFileLocation(const char *file, int line)
GTEST_API_::std::string FormatCompilerIndependentFileLocation(const char *file, int line)
size_t GetFileSize(FILE *file)
std::string ReadEntireFile(FILE *file)
static std::string FlagToEnvVar(const char *flag)
bool ParseInt32(const Message &src_text, const char *str, int32_t *value)
bool BoolFromGTestEnv(const char *flag, bool default_value)
int32_t Int32FromGTestEnv(const char *flag, int32_t default_value)
std::string OutputFlagAlsoCheckEnvVar()
const char *StringFromGTestEnv(const char *flag, const char *default_value)
void PrintBytesInObjectTo(const unsigned char *obj_bytes, size_t count, ostream *os)
inline bool IsPrintableAscii(char32_t c)
template<typename Char>
static CharFormat PrintAsCharLiteralTo(Char c, ostream *os)
static CharFormat PrintAsStringLiteralTo(char32_t c, ostream *os)
static const char *GetCharWidthPrefix(char)
static const char *GetCharWidthPrefix(signed char)
static const char *GetCharWidthPrefix(unsigned char)
static const char *GetCharWidthPrefix(char16_t)
static const char *GetCharWidthPrefix(char32_t)
static const char *GetCharWidthPrefix(wchar_t)
static CharFormat PrintAsStringLiteralTo(char c, ostream *os)
static CharFormat PrintAsStringLiteralTo(char16_t c, ostream *os)
static CharFormat PrintAsStringLiteralTo(wchar_t c, ostream *os)
template<typename Char>
void PrintCharAndCodeTo(Char c, ostream *os)
void PrintTo(wchar_t wc, ostream *os)
template<typename CharType> static GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ CharFormat PrintCharsAsStringTo (const CharType *begin, size_t len, ostream *os)
template<typename CharType> static GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_ static GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ void UniversalPrintCharArray (const CharType *begin, size_t len, ostream *os)
void UniversalPrintArray(const char *begin, size_t len, ostream *os)
void UniversalPrintArray(const char16_t *begin, size_t len, ostream *os)
void UniversalPrintArray(const char32_t *begin, size_t len, ostream *os)
void UniversalPrintArray(const wchar_t *begin, size_t len, ostream *os)
void PrintTo(const char *s, ostream *os)
void PrintTo(const char16_t *s, ostream *os)
void PrintTo(const char32_t *s, ostream *os)
void PrintTo(const wchar_t *s, ostream *os)
void PrintStringTo(const ::std::string &s, ostream *os)
void PrintU16StringTo(const ::std::u16string &s, ostream *os)
void PrintU32StringTo(const ::std::u32string &s, ostream *os)
static const char *SkipSpaces(const char *str)
static std::vector<std::string> SplitIntoTestNames(const char *src)
static FILE *OpenFileForWriting(const std::string &output_file)
static bool GTestIsInitialized()
static int SumOverTestSuiteList(const std::vector<TestSuite*> &case_list, int (TestSuite::* method)() const)
static bool TestSuitePassed(const TestSuite *test_suite)
static bool TestSuiteFailed(const TestSuite *test_suite)
static bool ShouldRunTestSuite(const TestSuite *test_suite)
std::set<std::string> *GetIgnoredParameterizedTestSuites()
void InsertSyntheticTestCase(const std::string &name, CodeLocation location, bool has_test_p)
void RegisterTypeParameterizedTestSuite(const char *test_suite_name, CodeLocation code_location)
void RegisterTypeParameterizedTestSuiteInstantiation(const char *case_name)
::std::vector<std::string> GetArgvs()
FilePath GetCurrentExecutableName()
static bool PatternMatchesString(const std::string &name_str, const char *pattern, const char *pattern_end)
TypeId GetTestTypeId()
static AssertionResult HasOneFailure(const char*, const char*, const char*, const TestPartResultArray &results, TestPartResult::Type type, const std::string &substr)
TimeInMillis GetTimeInMillis()
void SplitString(const ::std::string &str, char delimiter, ::std::vector<::std::string> *dest)
AssertionResult EqFailure(const char *lhs_expression, const char *rhs_expression, const std::string &lhs_value, const std::string &rhs_value, bool ignoring_case)
std::string GetBoolAssertionFailureMessage(const AssertionResult &assertion_result, const char *expression_text, const char *actual_predicate_value, const char *expected_predicate_value)
template<typename RawType>
AssertionResult FloatingPointLE(const char *expr1, const char *expr2, RawType val1, RawType val2)
inline uint32_t ChopLowBits(uint32_t *bits, int n)
std::string CodePointToUtf8(uint32_t code_point)
inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second)
inline uint32_t CreateCodePointFromUtf16SurrogatePair(wchar_t first, wchar_t second)
std::string WideStringToUtf8(const wchar_t *str, int num_chars)
std::string StringStreamToString(::std::stringstream *ss)
std::string AppendUserMessage(const std::string &gtest_msg, const Message &user_msg)
void ReportFailureInUnknownLocation(TestPartResult::Type result_type, const std::string &message)
template<class T, typename Result>
Result HandleSehExceptionsInMethodIfSupported(T *object, Result (T::* method)()const char *location, )
template<class T, typename Result>
Result HandleExceptionsInMethodIfSupported(T *object, Result (T::* method)()const char *location, )
TestInfo *MakeAndRegisterTestInfo(const char *test_suite_name, const char *name, const char *type_param, const char *value_param, CodeLocation code_location, TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc, TearDownTestSuiteFunc tear_down_tc, TestFactoryBase *factory)
void ReportInvalidTestSuiteType(const char *test_suite_name, CodeLocation code_location)
static std::string PrintTestPartResultToString(const TestPartResult &test_part_result)
static void PrintTestPartResult(const TestPartResult &test_part_result)
static const char *GetAnsiColorCode(GTestColor color)
bool ShouldUseColor(bool stdout_is_tty)
static void ColoredPrintf(GTestColor color, const char *fmt, ...)
static void PrintFullTestCommentIfPresent(const TestInfo &test_info)
std::string FormatTimeInMillisAsSeconds(TimeInMillis ms)
static bool PortableLocaltime(time_t seconds, struct tm *out)
std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms)
static std::string FormatTimeInMillisAsDuration(TimeInMillis ms)
static std::string FormatEpochTimeInMillisAsRFC3339(TimeInMillis ms)
static inline std::string Indent(size_t width)
static void SetUpEnvironment(Environment *env)
static void TearDownEnvironment(Environment *env)
void WriteToShardStatusFileIfNeeded()
bool ShouldShard(const char *total_shards_env, const char *shard_index_env, bool in_subprocess_for_death_test)
int32_t Int32FromEnvOrDie(const char *var, int32_t default_val)
bool ShouldRunTestOnShard(int total_shards, int shard_index, int test_id)
static void PrintOnOneLine(const char *str, int max_length)
std::string GetCurrentOsStackTraceExceptTop(UnitTest*, int skip_count)
bool IsTrue(bool condition)
bool AlwaysTrue()
bool SkipPrefix(const char *prefix, const char **pstr)
static const char *ParseFlagValue(const char *str, const char *flag, bool def_optional)
static bool ParseBoolFlag(const char *str, const char *flag, bool *value)
bool ParseInt32Flag(const char *str, const char *flag, int32_t *value)
template<typename String>
static bool ParseStringFlag(const char *str, const char *flag, String *value)
static bool HasGoogleTestFlagPrefix(const char *str)
static void PrintColorEncoded(const char *str)
static bool ParseGoogleTestFlag(const char *const arg)
template<typename CharType>
void ParseGoogleTestFlagsOnlyImpl(int *argc, CharType **argv)
void ParseGoogleTestFlagsOnly(int *argc, char **argv)
void ParseGoogleTestFlagsOnly(int *argc, wchar_t **argv)
template<typename CharType>
void InitGoogleTestImpl(int *argc, CharType **argv)
TEST_F(ListenerTest, DoesFoo)
TEST_F(ListenerTest, DoesBar)
TEST(IsXDigitTest, WorksForNarrowAscii)
TEST(IsXDigitTest, ReturnsFalseForNarrowNonAscii)
TEST(IsXDigitTest, WorksForWideAscii)
TEST(IsXDigitTest, ReturnsFalseForWideNonAscii)
TEST(ImplicitCastTest, ConvertsPointers)
TEST(ImplicitCastTest, CanUseInheritance)
TEST(ImplicitCastTest, CanUseNonConstCastOperator)
TEST(ImplicitCastTest, CanUseConstCastOperatorOnConstValues)
TEST(ImplicitCastTest, CanSelectBetweenConstAndNonConstCasrAppropriately)
TEST(ImplicitCastTest, CanUseImplicitConstructor)
TEST(GtestCheckSyntaxTest, BehavesLikeASingleStatement)
TEST(GtestCheckSyntaxTest, WorksWithSwitch)
TEST(FormatFileLocationTest, FormatsFileLocation)
TEST(FormatFileLocationTest, FormatsUnknownFile)
TEST(FormatFileLocationTest, FormatsUknownLine)
TEST(FormatFileLocationTest, FormatsUknownFileAndLine)
TEST(FormatCompilerIndependentFileLocationTest, FormatsFileLocation)
TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownFile)
TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownLine)
TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownFileAndLine)
TEST(GetThreadCountTest, ReturnsZeroWhenUnableToCountThreads)
TEST(GtestCheckDeathTest, DiesWithCorrectOutputOnFailure)
TEST(RegexEngineSelectionTest, SelectsCorrectRegexEngine)
TEST(CaptureTest, CapturesStdout)
TEST(CaptureTest, CapturesStderr)
TEST(CaptureTest, CapturesStdoutAndStderr)
TEST(CaptureDeathTest, CannotReenterStdoutCapture)
TEST(ThreadLocalTest, DefaultConstructorInitializesToDefaultValues)
TEST(ThreadLocalTest, SingleParamConstructorInitializesToParam)
TEST(ThreadLocalTest, ValueDefaultContructorIsNotRequiredForParamVersion)
TEST(ThreadLocalTest, GetAndPointerReturnSameValue)
TEST(ThreadLocalTest, PointerAndConstPointerReturnSameValue)
TYPED_TEST_SUITE(TestSuiteWithCommentTest, Types<int>)
TYPED_TEST(TestSuiteWithCommentTest, Dummy)
TEST(ApiTest, UnitTestImmutableAccessorsWork)
AssertionResult IsNull(const char *str)
TEST(ApiTest, TestSuiteImmutableAccessorsWork)
TEST(ApiTest, TestSuiteDisabledAccessorsWork)
TEST(ApiTest, DISABLED_Dummy1)
TEST(DISABLED_Test, Dummy2)

Variables

GTEST_API_ ThreadLocal< Sequence * > g_gmock_implicit_sequence
const char kPathSeparator = '/'
const char kCurrentDirectoryString[] = "./"
const int kStdOutFileno = STDOUT_FILENO
const int kStdErrFileno = STDERR_FILENO
const char kUnknownFile[] = "unknown file"
const char kStackTraceMarker[] = "\nStack trace:\n"
bool g_help_flag = false
::std::vector<std::string> g_argvs
const TypeId kTestTypeIdInGoogleTest = GetTestTypeId()
constexpr uint32_t kMaxCodePoint1 = (static_cast<uint32_t>(1) << 7) - 1
constexpr uint32_t kMaxCodePoint2 = (static_cast<uint32_t>(1) << (5 + 6)) - 1
constexpr uint32_t kMaxCodePoint3 = (static_cast<uint32_t>(1) << (4 + 2 * 6)) - 1
constexpr uint32_t kMaxCodePoint4 = (static_cast<uint32_t>(1) << (3 + 3 * 6)) - 1
static const char kTypeParamLabel[] = "TypeParam"
static const char kValueParamLabel[] = "GetParam()"
static const char kColorEncodedHelpMessage[]
const int kTypedTestSuites = 1
const int kTypedTests = 1
namespace [anonymous]
namespace testing::internal::[anonymous]

Enums

enum GTestColor

Values:

enumerator kDefault
enumerator kRed
enumerator kGreen
enumerator kYellow
namespace [anonymous]
namespace [anonymous]
namespace [anonymous]
namespace testing::internal::edit_distance

Functions

std::vector<EditType> CalculateOptimalEdits(const std::vector<size_t> &left, const std::vector<size_t> &right)
std::vector<EditType> CalculateOptimalEdits(const std::vector<std::string> &left, const std::vector<std::string> &right)
std::string CreateUnifiedDiff(const std::vector<std::string> &left, const std::vector<std::string> &right, size_t context)
namespace [anonymous]
namespace gmockpp
namespace testing::internal::internal_stream_operator_without_lexical_name_lookup

Functions

void operator<<(LookupBlocker, LookupBlocker)
namespace works_here

Typedefs

using OtherName = NotInstantiatedTest

Functions

TYPED_TEST_SUITE_P(NotUsedTypeTest)
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(NotInstantiatedTest)
TEST_P(NotInstantiatedTest, Used)
TYPED_TEST_SUITE_P(NotInstantiatedTypeTest)
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(NotInstantiatedTypeTest)
TYPED_TEST_P(NotInstantiatedTypeTest, Used)
REGISTER_TYPED_TEST_SUITE_P(NotInstantiatedTypeTest, Used)
namespace YAML

Functions

template<typename YamlType>
static YamlType ReadParameter(const YAML::Node &node, const std::string &name)

helper function to safely read a yaml parameter

Template Parameters

YamlType

Parameters
  • node

  • name

Returns

YamlType

template<typename YamlType>
static void ReadParameter(const YAML::Node &node, const std::string &name, YamlType &parameter, bool optional = false)

helper function to safely read a yaml parameter

Template Parameters

YamlType

Parameters
  • node

  • name

  • parameter

template<typename YamlType>
static void ReadParameterDefault(const YAML::Node &node, const std::string &name, YamlType &parameter, YamlType default_value)
template<typename YamlType>
void readParameter(const YAML::Node &node, const std::string &name, YamlType &parameter, bool optional = false)

helper function to safely read a yaml parameter

Parameters
  • node

  • name

  • optional

Template Parameters

YamlType

Returns

YamlType

template<typename YamlType>
static YamlType ReadParameter(const YAML::Node &node, const std::string &name)

helper function to safely read a yaml parameter

Template Parameters

YamlType

Parameters
  • node

  • name

Returns

YamlType

template<typename YamlType>
static void ReadParameter(const YAML::Node &node, const std::string &name, YamlType &parameter, bool optional = false)

helper function to safely read a yaml parameter

Template Parameters

YamlType

Parameters
  • node

  • name

  • parameter

template<typename YamlType>
static void ReadParameterDefault(const YAML::Node &node, const std::string &name, YamlType &parameter, YamlType default_value)
file demo_pid.cpp
#include “package_template/pid.hpp”

Example of a simple demo suitable for continuous integration.

Author

Vincent Berenz license License BSD-3-Clause

Copyright

Copyright (c) 2019, New York University and Max Planck Gesellschaft.

Date

2019-05-22

See

https://git-amd.tuebingen.mpg.de/amd-clmc/package_template/wikis/catkin:-how-to-implement-a-demo

Functions

void run_demo()

Creates a PID controller and use the API in a small demo.

int main()

Execute the run_demo() trhough a try/catch expression.

Returns

int

file demo_pid_load_from_file.cpp
#include <stdexcept>#include “package_template/file_configuration.hpp”#include “package_template/pid.hpp”

Example of a demo that requires to read a config file.

Author

Vincent Berenz license License BSD-3-Clause

Copyright

Copyright (c) 2019, New York University and Max Planck Gesellschaft.

Date

2019-05-22

See

https://git-amd.tuebingen.mpg.de/amd-clmc/package_template/wikis/catkin:-how-to-implement-a-demo

Functions

void run_demo()

Run some demo using a YAML file as configuration for the PID controller.

int main()

Run the demo in a safe environment.

file gmock-actions.h
#include <errno.h>#include <algorithm>#include <functional>#include <memory>#include <string>#include <tuple>#include <type_traits>#include <utility>#include “gmock/internal/gmock-internal-utils.h”#include “gmock/internal/gmock-port.h”#include “gmock/internal/gmock-pp.h”

Defines

GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(type, value)
GMOCK_INTERNAL_ARG_UNUSED(i, data, el)
GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_
GMOCK_INTERNAL_ARG(i, data, el)
GMOCK_ACTION_ARG_TYPES_AND_NAMES_
GMOCK_INTERNAL_TEMPLATE_ARG(i, data, el)
GMOCK_ACTION_TEMPLATE_ARGS_NAMES_
GMOCK_INTERNAL_TYPENAME_PARAM(i, data, param)
GMOCK_ACTION_TYPENAME_PARAMS_(params)
GMOCK_INTERNAL_TYPE_PARAM(i, data, param)
GMOCK_ACTION_TYPE_PARAMS_(params)
GMOCK_INTERNAL_TYPE_GVALUE_PARAM(i, data, param)
GMOCK_ACTION_TYPE_GVALUE_PARAMS_(params)
GMOCK_INTERNAL_GVALUE_PARAM(i, data, param)
GMOCK_ACTION_GVALUE_PARAMS_(params)
GMOCK_INTERNAL_INIT_PARAM(i, data, param)
GMOCK_ACTION_INIT_PARAMS_(params)
GMOCK_INTERNAL_FIELD_PARAM(i, data, param)
GMOCK_ACTION_FIELD_PARAMS_(params)
GMOCK_INTERNAL_ACTION(name, full_name, params)
ACTION(name)
ACTION_P(name, ...)
ACTION_P2(name, ...)
ACTION_P3(name, ...)
ACTION_P4(name, ...)
ACTION_P5(name, ...)
ACTION_P6(name, ...)
ACTION_P7(name, ...)
ACTION_P8(name, ...)
ACTION_P9(name, ...)
ACTION_P10(name, ...)
file gmock-actions.h
#include <errno.h>#include <algorithm>#include <functional>#include <memory>#include <string>#include <tuple>#include <type_traits>#include <utility>#include “gmock/internal/gmock-internal-utils.h”#include “gmock/internal/gmock-port.h”#include “gmock/internal/gmock-pp.h”

Defines

GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(type, value)
GMOCK_INTERNAL_ARG_UNUSED(i, data, el)
GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_
GMOCK_INTERNAL_ARG(i, data, el)
GMOCK_ACTION_ARG_TYPES_AND_NAMES_
GMOCK_INTERNAL_TEMPLATE_ARG(i, data, el)
GMOCK_ACTION_TEMPLATE_ARGS_NAMES_
GMOCK_INTERNAL_TYPENAME_PARAM(i, data, param)
GMOCK_ACTION_TYPENAME_PARAMS_(params)
GMOCK_INTERNAL_TYPE_PARAM(i, data, param)
GMOCK_ACTION_TYPE_PARAMS_(params)
GMOCK_INTERNAL_TYPE_GVALUE_PARAM(i, data, param)
GMOCK_ACTION_TYPE_GVALUE_PARAMS_(params)
GMOCK_INTERNAL_GVALUE_PARAM(i, data, param)
GMOCK_ACTION_GVALUE_PARAMS_(params)
GMOCK_INTERNAL_INIT_PARAM(i, data, param)
GMOCK_ACTION_INIT_PARAMS_(params)
GMOCK_INTERNAL_FIELD_PARAM(i, data, param)
GMOCK_ACTION_FIELD_PARAMS_(params)
GMOCK_INTERNAL_ACTION(name, full_name, params)
ACTION(name)
ACTION_P(name, ...)
ACTION_P2(name, ...)
ACTION_P3(name, ...)
ACTION_P4(name, ...)
ACTION_P5(name, ...)
ACTION_P6(name, ...)
ACTION_P7(name, ...)
ACTION_P8(name, ...)
ACTION_P9(name, ...)
ACTION_P10(name, ...)
file gmock-cardinalities.h
#include <limits.h>#include <memory>#include <ostream>#include “gmock/internal/gmock-port.h”#include “gtest/gtest.h”

Functions

GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251) namespace testing
file gmock-cardinalities.h
#include <limits.h>#include <memory>#include <ostream>#include “gmock/internal/gmock-port.h”#include “gtest/gtest.h”

Functions

GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251) namespace testing
file gmock-function-mocker.h
#include <type_traits>#include <utility>#include “gmock/gmock-spec-builders.h”#include “gmock/internal/gmock-internal-utils.h”#include “gmock/internal/gmock-pp.h”

Defines

GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_FUNCTION_MOCKER_H_
MOCK_METHOD(...)
GMOCK_INTERNAL_MOCK_METHOD_ARG_1(...)
GMOCK_INTERNAL_MOCK_METHOD_ARG_2(...)
GMOCK_INTERNAL_MOCK_METHOD_ARG_3(_Ret, _MethodName, _Args)
GMOCK_INTERNAL_MOCK_METHOD_ARG_4(_Ret, _MethodName, _Args, _Spec)
GMOCK_INTERNAL_MOCK_METHOD_ARG_5(...)
GMOCK_INTERNAL_MOCK_METHOD_ARG_6(...)
GMOCK_INTERNAL_MOCK_METHOD_ARG_7(...)
GMOCK_INTERNAL_WRONG_ARITY(...)
GMOCK_INTERNAL_ASSERT_PARENTHESIS(_Tuple)
GMOCK_INTERNAL_ASSERT_VALID_SIGNATURE(_N, ...)
GMOCK_INTERNAL_ASSERT_VALID_SPEC(_Spec)
GMOCK_INTERNAL_MOCK_METHOD_IMPL(_N, _MethodName, _Constness, _Override, _Final, _NoexceptSpec, _CallType, _RefSpec, _Signature)
GMOCK_INTERNAL_EXPAND(...)
GMOCK_INTERNAL_HAS_CONST(_Tuple)
GMOCK_INTERNAL_HAS_OVERRIDE(_Tuple)
GMOCK_INTERNAL_HAS_FINAL(_Tuple)
GMOCK_INTERNAL_GET_NOEXCEPT_SPEC(_Tuple)
GMOCK_INTERNAL_NOEXCEPT_SPEC_IF_NOEXCEPT(_i, _, _elem)
GMOCK_INTERNAL_GET_REF_SPEC(_Tuple)
GMOCK_INTERNAL_REF_SPEC_IF_REF(_i, _, _elem)
GMOCK_INTERNAL_GET_CALLTYPE(_Tuple)
GMOCK_INTERNAL_ASSERT_VALID_SPEC_ELEMENT(_i, _, _elem)
GMOCK_INTERNAL_DETECT_CONST(_i, _, _elem)
GMOCK_INTERNAL_DETECT_CONST_I_const
GMOCK_INTERNAL_DETECT_OVERRIDE(_i, _, _elem)
GMOCK_INTERNAL_DETECT_OVERRIDE_I_override
GMOCK_INTERNAL_DETECT_FINAL(_i, _, _elem)
GMOCK_INTERNAL_DETECT_FINAL_I_final
GMOCK_INTERNAL_DETECT_NOEXCEPT(_i, _, _elem)
GMOCK_INTERNAL_DETECT_NOEXCEPT_I_noexcept
GMOCK_INTERNAL_DETECT_REF(_i, _, _elem)
GMOCK_INTERNAL_DETECT_REF_I_ref
GMOCK_INTERNAL_UNPACK_ref(x)
GMOCK_INTERNAL_GET_CALLTYPE_IMPL(_i, _, _elem)
GMOCK_INTERNAL_IS_CALLTYPE(_arg)
GMOCK_INTERNAL_IS_CALLTYPE_I(_arg)
GMOCK_INTERNAL_GET_VALUE_CALLTYPE(_arg)
GMOCK_INTERNAL_GET_VALUE_CALLTYPE_I(_arg)
GMOCK_INTERNAL_IS_CALLTYPE_HELPER_Calltype
GMOCK_INTERNAL_SIGNATURE(_Ret, _Args)
GMOCK_INTERNAL_GET_TYPE(_i, _, _elem)
GMOCK_INTERNAL_PARAMETER(_i, _Signature, _)
GMOCK_INTERNAL_FORWARD_ARG(_i, _Signature, _)
GMOCK_INTERNAL_MATCHER_PARAMETER(_i, _Signature, _)
GMOCK_INTERNAL_MATCHER_ARGUMENT(_i, _1, _2)
GMOCK_INTERNAL_A_MATCHER_ARGUMENT(_i, _Signature, _)
GMOCK_INTERNAL_ARG_O(_i, ...)
GMOCK_INTERNAL_MATCHER_O(_i, ...)
MOCK_METHOD0(m, ...)
MOCK_METHOD1(m, ...)
MOCK_METHOD2(m, ...)
MOCK_METHOD3(m, ...)
MOCK_METHOD4(m, ...)
MOCK_METHOD5(m, ...)
MOCK_METHOD6(m, ...)
MOCK_METHOD7(m, ...)
MOCK_METHOD8(m, ...)
MOCK_METHOD9(m, ...)
MOCK_METHOD10(m, ...)
MOCK_CONST_METHOD0(m, ...)
MOCK_CONST_METHOD1(m, ...)
MOCK_CONST_METHOD2(m, ...)
MOCK_CONST_METHOD3(m, ...)
MOCK_CONST_METHOD4(m, ...)
MOCK_CONST_METHOD5(m, ...)
MOCK_CONST_METHOD6(m, ...)
MOCK_CONST_METHOD7(m, ...)
MOCK_CONST_METHOD8(m, ...)
MOCK_CONST_METHOD9(m, ...)
MOCK_CONST_METHOD10(m, ...)
MOCK_METHOD0_T(m, ...)
MOCK_METHOD1_T(m, ...)
MOCK_METHOD2_T(m, ...)
MOCK_METHOD3_T(m, ...)
MOCK_METHOD4_T(m, ...)
MOCK_METHOD5_T(m, ...)
MOCK_METHOD6_T(m, ...)
MOCK_METHOD7_T(m, ...)
MOCK_METHOD8_T(m, ...)
MOCK_METHOD9_T(m, ...)
MOCK_METHOD10_T(m, ...)
MOCK_CONST_METHOD0_T(m, ...)
MOCK_CONST_METHOD1_T(m, ...)
MOCK_CONST_METHOD2_T(m, ...)
MOCK_CONST_METHOD3_T(m, ...)
MOCK_CONST_METHOD4_T(m, ...)
MOCK_CONST_METHOD5_T(m, ...)
MOCK_CONST_METHOD6_T(m, ...)
MOCK_CONST_METHOD7_T(m, ...)
MOCK_CONST_METHOD8_T(m, ...)
MOCK_CONST_METHOD9_T(m, ...)
MOCK_CONST_METHOD10_T(m, ...)
MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...)
GMOCK_INTERNAL_MOCK_METHODN(constness, ct, Method, args_num, ...)
GMOCK_MOCKER_(arity, constness, Method)
file gmock-function-mocker.h
#include <type_traits>#include <utility>#include “gmock/gmock-spec-builders.h”#include “gmock/internal/gmock-internal-utils.h”#include “gmock/internal/gmock-pp.h”

Defines

GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_FUNCTION_MOCKER_H_
MOCK_METHOD(...)
GMOCK_INTERNAL_MOCK_METHOD_ARG_1(...)
GMOCK_INTERNAL_MOCK_METHOD_ARG_2(...)
GMOCK_INTERNAL_MOCK_METHOD_ARG_3(_Ret, _MethodName, _Args)
GMOCK_INTERNAL_MOCK_METHOD_ARG_4(_Ret, _MethodName, _Args, _Spec)
GMOCK_INTERNAL_MOCK_METHOD_ARG_5(...)
GMOCK_INTERNAL_MOCK_METHOD_ARG_6(...)
GMOCK_INTERNAL_MOCK_METHOD_ARG_7(...)
GMOCK_INTERNAL_WRONG_ARITY(...)
GMOCK_INTERNAL_ASSERT_PARENTHESIS(_Tuple)
GMOCK_INTERNAL_ASSERT_VALID_SIGNATURE(_N, ...)
GMOCK_INTERNAL_ASSERT_VALID_SPEC(_Spec)
GMOCK_INTERNAL_MOCK_METHOD_IMPL(_N, _MethodName, _Constness, _Override, _Final, _NoexceptSpec, _CallType, _RefSpec, _Signature)
GMOCK_INTERNAL_EXPAND(...)
GMOCK_INTERNAL_HAS_CONST(_Tuple)
GMOCK_INTERNAL_HAS_OVERRIDE(_Tuple)
GMOCK_INTERNAL_HAS_FINAL(_Tuple)
GMOCK_INTERNAL_GET_NOEXCEPT_SPEC(_Tuple)
GMOCK_INTERNAL_NOEXCEPT_SPEC_IF_NOEXCEPT(_i, _, _elem)
GMOCK_INTERNAL_GET_REF_SPEC(_Tuple)
GMOCK_INTERNAL_REF_SPEC_IF_REF(_i, _, _elem)
GMOCK_INTERNAL_GET_CALLTYPE(_Tuple)
GMOCK_INTERNAL_ASSERT_VALID_SPEC_ELEMENT(_i, _, _elem)
GMOCK_INTERNAL_DETECT_CONST(_i, _, _elem)
GMOCK_INTERNAL_DETECT_CONST_I_const
GMOCK_INTERNAL_DETECT_OVERRIDE(_i, _, _elem)
GMOCK_INTERNAL_DETECT_OVERRIDE_I_override
GMOCK_INTERNAL_DETECT_FINAL(_i, _, _elem)
GMOCK_INTERNAL_DETECT_FINAL_I_final
GMOCK_INTERNAL_DETECT_NOEXCEPT(_i, _, _elem)
GMOCK_INTERNAL_DETECT_NOEXCEPT_I_noexcept
GMOCK_INTERNAL_DETECT_REF(_i, _, _elem)
GMOCK_INTERNAL_DETECT_REF_I_ref
GMOCK_INTERNAL_UNPACK_ref(x)
GMOCK_INTERNAL_GET_CALLTYPE_IMPL(_i, _, _elem)
GMOCK_INTERNAL_IS_CALLTYPE(_arg)
GMOCK_INTERNAL_IS_CALLTYPE_I(_arg)
GMOCK_INTERNAL_GET_VALUE_CALLTYPE(_arg)
GMOCK_INTERNAL_GET_VALUE_CALLTYPE_I(_arg)
GMOCK_INTERNAL_IS_CALLTYPE_HELPER_Calltype
GMOCK_INTERNAL_SIGNATURE(_Ret, _Args)
GMOCK_INTERNAL_GET_TYPE(_i, _, _elem)
GMOCK_INTERNAL_PARAMETER(_i, _Signature, _)
GMOCK_INTERNAL_FORWARD_ARG(_i, _Signature, _)
GMOCK_INTERNAL_MATCHER_PARAMETER(_i, _Signature, _)
GMOCK_INTERNAL_MATCHER_ARGUMENT(_i, _1, _2)
GMOCK_INTERNAL_A_MATCHER_ARGUMENT(_i, _Signature, _)
GMOCK_INTERNAL_ARG_O(_i, ...)
GMOCK_INTERNAL_MATCHER_O(_i, ...)
MOCK_METHOD0(m, ...)
MOCK_METHOD1(m, ...)
MOCK_METHOD2(m, ...)
MOCK_METHOD3(m, ...)
MOCK_METHOD4(m, ...)
MOCK_METHOD5(m, ...)
MOCK_METHOD6(m, ...)
MOCK_METHOD7(m, ...)
MOCK_METHOD8(m, ...)
MOCK_METHOD9(m, ...)
MOCK_METHOD10(m, ...)
MOCK_CONST_METHOD0(m, ...)
MOCK_CONST_METHOD1(m, ...)
MOCK_CONST_METHOD2(m, ...)
MOCK_CONST_METHOD3(m, ...)
MOCK_CONST_METHOD4(m, ...)
MOCK_CONST_METHOD5(m, ...)
MOCK_CONST_METHOD6(m, ...)
MOCK_CONST_METHOD7(m, ...)
MOCK_CONST_METHOD8(m, ...)
MOCK_CONST_METHOD9(m, ...)
MOCK_CONST_METHOD10(m, ...)
MOCK_METHOD0_T(m, ...)
MOCK_METHOD1_T(m, ...)
MOCK_METHOD2_T(m, ...)
MOCK_METHOD3_T(m, ...)
MOCK_METHOD4_T(m, ...)
MOCK_METHOD5_T(m, ...)
MOCK_METHOD6_T(m, ...)
MOCK_METHOD7_T(m, ...)
MOCK_METHOD8_T(m, ...)
MOCK_METHOD9_T(m, ...)
MOCK_METHOD10_T(m, ...)
MOCK_CONST_METHOD0_T(m, ...)
MOCK_CONST_METHOD1_T(m, ...)
MOCK_CONST_METHOD2_T(m, ...)
MOCK_CONST_METHOD3_T(m, ...)
MOCK_CONST_METHOD4_T(m, ...)
MOCK_CONST_METHOD5_T(m, ...)
MOCK_CONST_METHOD6_T(m, ...)
MOCK_CONST_METHOD7_T(m, ...)
MOCK_CONST_METHOD8_T(m, ...)
MOCK_CONST_METHOD9_T(m, ...)
MOCK_CONST_METHOD10_T(m, ...)
MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...)
MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...)
MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...)
GMOCK_INTERNAL_MOCK_METHODN(constness, ct, Method, args_num, ...)
GMOCK_MOCKER_(arity, constness, Method)
file gmock-matchers.h
#include <algorithm>#include <cmath>#include <initializer_list>#include <iterator>#include <limits>#include <memory>#include <ostream>#include <sstream>#include <string>#include <type_traits>#include <utility>#include <vector>#include “gmock/internal/gmock-internal-utils.h”#include “gmock/internal/gmock-port.h”#include “gmock/internal/gmock-pp.h”#include “gtest/gtest.h”#include “gmock/internal/custom/gmock-matchers.h”

Defines

GMOCK_MAYBE_5046_

<< DiffStrings(str, arg);

ASSERT_THAT(value, matcher)
EXPECT_THAT(value, matcher)
MATCHER(name, description)
MATCHER_P(name, p0, description)
MATCHER_P2(name, p0, p1, description)
MATCHER_P3(name, p0, p1, p2, description)
MATCHER_P4(name, p0, p1, p2, p3, description)
MATCHER_P5(name, p0, p1, p2, p3, p4, description)
MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)
MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)
MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)
MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)
MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)
GMOCK_INTERNAL_MATCHER(name, full_name, description, args)
GMOCK_INTERNAL_MATCHER_TEMPLATE_PARAMS(args)
GMOCK_INTERNAL_MATCHER_TEMPLATE_PARAM(i_unused, data_unused, arg)
GMOCK_INTERNAL_MATCHER_TYPE_PARAMS(args)
GMOCK_INTERNAL_MATCHER_TYPE_PARAM(i_unused, data_unused, arg)
GMOCK_INTERNAL_MATCHER_FUNCTION_ARGS(args)
GMOCK_INTERNAL_MATCHER_FUNCTION_ARG(i, data_unused, arg)
GMOCK_INTERNAL_MATCHER_FORWARD_ARGS(args)
GMOCK_INTERNAL_MATCHER_FORWARD_ARG(i, data_unused, arg)
GMOCK_INTERNAL_MATCHER_MEMBERS(args)
GMOCK_INTERNAL_MATCHER_MEMBER(i_unused, data_unused, arg)
GMOCK_INTERNAL_MATCHER_MEMBERS_USAGE(args)
GMOCK_INTERNAL_MATCHER_MEMBER_USAGE(i_unused, data_unused, arg)
GMOCK_INTERNAL_MATCHER_ARGS_USAGE(args)
GMOCK_INTERNAL_MATCHER_ARG_USAGE(i, data_unused, arg_unused)

Functions

GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251 GMOCK_MAYBE_5046_) namespace testing
file gmock-matchers.h
#include <algorithm>#include <cmath>#include <initializer_list>#include <iterator>#include <limits>#include <memory>#include <ostream>#include <sstream>#include <string>#include <type_traits>#include <utility>#include <vector>#include “gmock/internal/gmock-internal-utils.h”#include “gmock/internal/gmock-port.h”#include “gmock/internal/gmock-pp.h”#include “gtest/gtest.h”#include “gmock/internal/custom/gmock-matchers.h”

Defines

GMOCK_MAYBE_5046_

<< DiffStrings(str, arg);

ASSERT_THAT(value, matcher)
EXPECT_THAT(value, matcher)
MATCHER(name, description)
MATCHER_P(name, p0, description)
MATCHER_P2(name, p0, p1, description)
MATCHER_P3(name, p0, p1, p2, description)
MATCHER_P4(name, p0, p1, p2, p3, description)
MATCHER_P5(name, p0, p1, p2, p3, p4, description)
MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)
MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)
MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)
MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)
MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)
GMOCK_INTERNAL_MATCHER(name, full_name, description, args)
GMOCK_INTERNAL_MATCHER_TEMPLATE_PARAMS(args)
GMOCK_INTERNAL_MATCHER_TEMPLATE_PARAM(i_unused, data_unused, arg)
GMOCK_INTERNAL_MATCHER_TYPE_PARAMS(args)
GMOCK_INTERNAL_MATCHER_TYPE_PARAM(i_unused, data_unused, arg)
GMOCK_INTERNAL_MATCHER_FUNCTION_ARGS(args)
GMOCK_INTERNAL_MATCHER_FUNCTION_ARG(i, data_unused, arg)
GMOCK_INTERNAL_MATCHER_FORWARD_ARGS(args)
GMOCK_INTERNAL_MATCHER_FORWARD_ARG(i, data_unused, arg)
GMOCK_INTERNAL_MATCHER_MEMBERS(args)
GMOCK_INTERNAL_MATCHER_MEMBER(i_unused, data_unused, arg)
GMOCK_INTERNAL_MATCHER_MEMBERS_USAGE(args)
GMOCK_INTERNAL_MATCHER_MEMBER_USAGE(i_unused, data_unused, arg)
GMOCK_INTERNAL_MATCHER_ARGS_USAGE(args)
GMOCK_INTERNAL_MATCHER_ARG_USAGE(i, data_unused, arg_unused)

Functions

GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251 GMOCK_MAYBE_5046_) namespace testing
file gmock-more-actions.h
#include <memory>#include <utility>#include “gmock/gmock-actions.h”#include “gmock/internal/gmock-port.h”#include “gmock/internal/custom/gmock-generated-actions.h”

Defines

GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(kind0, name0)
GMOCK_INTERNAL_DECL_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, name1)
GMOCK_INTERNAL_DECL_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2)
GMOCK_INTERNAL_DECL_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3)
GMOCK_INTERNAL_DECL_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4)
GMOCK_INTERNAL_DECL_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5)
GMOCK_INTERNAL_DECL_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6)
GMOCK_INTERNAL_DECL_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, kind7, name7)
GMOCK_INTERNAL_DECL_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, kind7, name7, kind8, name8)
GMOCK_INTERNAL_DECL_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, kind7, name7, kind8, name8, kind9, name9)
GMOCK_INTERNAL_LIST_HAS_1_TEMPLATE_PARAMS(kind0, name0)
GMOCK_INTERNAL_LIST_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, name1)
GMOCK_INTERNAL_LIST_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2)
GMOCK_INTERNAL_LIST_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3)
GMOCK_INTERNAL_LIST_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4)
GMOCK_INTERNAL_LIST_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5)
GMOCK_INTERNAL_LIST_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6)
GMOCK_INTERNAL_LIST_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, kind7, name7)
GMOCK_INTERNAL_LIST_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, kind7, name7, kind8, name8)
GMOCK_INTERNAL_LIST_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, kind7, name7, kind8, name8, kind9, name9)
GMOCK_INTERNAL_DECL_TYPE_AND_0_VALUE_PARAMS()
GMOCK_INTERNAL_DECL_TYPE_AND_1_VALUE_PARAMS(p0)
GMOCK_INTERNAL_DECL_TYPE_AND_2_VALUE_PARAMS(p0, p1)
GMOCK_INTERNAL_DECL_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2)
GMOCK_INTERNAL_DECL_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3)
GMOCK_INTERNAL_DECL_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)
GMOCK_INTERNAL_DECL_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)
GMOCK_INTERNAL_DECL_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)
GMOCK_INTERNAL_DECL_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)
GMOCK_INTERNAL_DECL_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)
GMOCK_INTERNAL_DECL_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)
GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()
GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)
GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)
GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)
GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)
GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)
GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)
GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)
GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)
GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)
GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)
GMOCK_INTERNAL_DEFN_COPY_AND_0_VALUE_PARAMS()
GMOCK_INTERNAL_DEFN_COPY_AND_1_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_2_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_3_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_4_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_5_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_6_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_7_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_8_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_9_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_10_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS()
GMOCK_INTERNAL_DEFN_AND_1_VALUE_PARAMS(p0)
GMOCK_INTERNAL_DEFN_AND_2_VALUE_PARAMS(p0, p1)
GMOCK_INTERNAL_DEFN_AND_3_VALUE_PARAMS(p0, p1, p2)
GMOCK_INTERNAL_DEFN_AND_4_VALUE_PARAMS(p0, p1, p2, p3)
GMOCK_INTERNAL_DEFN_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)
GMOCK_INTERNAL_DEFN_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)
GMOCK_INTERNAL_DEFN_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)
GMOCK_INTERNAL_DEFN_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)
GMOCK_INTERNAL_DEFN_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)
GMOCK_INTERNAL_DEFN_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)
GMOCK_INTERNAL_LIST_AND_0_VALUE_PARAMS()
GMOCK_INTERNAL_LIST_AND_1_VALUE_PARAMS(p0)
GMOCK_INTERNAL_LIST_AND_2_VALUE_PARAMS(p0, p1)
GMOCK_INTERNAL_LIST_AND_3_VALUE_PARAMS(p0, p1, p2)
GMOCK_INTERNAL_LIST_AND_4_VALUE_PARAMS(p0, p1, p2, p3)
GMOCK_INTERNAL_LIST_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)
GMOCK_INTERNAL_LIST_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)
GMOCK_INTERNAL_LIST_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)
GMOCK_INTERNAL_LIST_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)
GMOCK_INTERNAL_LIST_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)
GMOCK_INTERNAL_LIST_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)
GMOCK_INTERNAL_LIST_TYPE_AND_0_VALUE_PARAMS()
GMOCK_INTERNAL_LIST_TYPE_AND_1_VALUE_PARAMS(p0)
GMOCK_INTERNAL_LIST_TYPE_AND_2_VALUE_PARAMS(p0, p1)
GMOCK_INTERNAL_LIST_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2)
GMOCK_INTERNAL_LIST_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3)
GMOCK_INTERNAL_LIST_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)
GMOCK_INTERNAL_LIST_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)
GMOCK_INTERNAL_LIST_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)
GMOCK_INTERNAL_LIST_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)
GMOCK_INTERNAL_LIST_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)
GMOCK_INTERNAL_LIST_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)
GMOCK_INTERNAL_DECL_AND_0_VALUE_PARAMS()
GMOCK_INTERNAL_DECL_AND_1_VALUE_PARAMS(p0)
GMOCK_INTERNAL_DECL_AND_2_VALUE_PARAMS(p0, p1)
GMOCK_INTERNAL_DECL_AND_3_VALUE_PARAMS(p0, p1, p2)
GMOCK_INTERNAL_DECL_AND_4_VALUE_PARAMS(p0, p1, p2, p3)
GMOCK_INTERNAL_DECL_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)
GMOCK_INTERNAL_DECL_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)
GMOCK_INTERNAL_DECL_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)
GMOCK_INTERNAL_DECL_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)
GMOCK_INTERNAL_DECL_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)
GMOCK_INTERNAL_DECL_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)
GMOCK_INTERNAL_COUNT_AND_0_VALUE_PARAMS()
GMOCK_INTERNAL_COUNT_AND_1_VALUE_PARAMS(p0)
GMOCK_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1)
GMOCK_INTERNAL_COUNT_AND_3_VALUE_PARAMS(p0, p1, p2)
GMOCK_INTERNAL_COUNT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)
GMOCK_INTERNAL_COUNT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)
GMOCK_INTERNAL_COUNT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)
GMOCK_INTERNAL_COUNT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)
GMOCK_INTERNAL_COUNT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)
GMOCK_INTERNAL_COUNT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)
GMOCK_INTERNAL_COUNT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)
GMOCK_ACTION_CLASS_(name, value_params)
ACTION_TEMPLATE(name, template_params, value_params)
file gmock-more-actions.h
#include <memory>#include <utility>#include “gmock/gmock-actions.h”#include “gmock/internal/gmock-port.h”#include “gmock/internal/custom/gmock-generated-actions.h”

Defines

GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(kind0, name0)
GMOCK_INTERNAL_DECL_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, name1)
GMOCK_INTERNAL_DECL_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2)
GMOCK_INTERNAL_DECL_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3)
GMOCK_INTERNAL_DECL_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4)
GMOCK_INTERNAL_DECL_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5)
GMOCK_INTERNAL_DECL_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6)
GMOCK_INTERNAL_DECL_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, kind7, name7)
GMOCK_INTERNAL_DECL_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, kind7, name7, kind8, name8)
GMOCK_INTERNAL_DECL_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, kind7, name7, kind8, name8, kind9, name9)
GMOCK_INTERNAL_LIST_HAS_1_TEMPLATE_PARAMS(kind0, name0)
GMOCK_INTERNAL_LIST_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, name1)
GMOCK_INTERNAL_LIST_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2)
GMOCK_INTERNAL_LIST_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3)
GMOCK_INTERNAL_LIST_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4)
GMOCK_INTERNAL_LIST_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5)
GMOCK_INTERNAL_LIST_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6)
GMOCK_INTERNAL_LIST_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, kind7, name7)
GMOCK_INTERNAL_LIST_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, kind7, name7, kind8, name8)
GMOCK_INTERNAL_LIST_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, kind7, name7, kind8, name8, kind9, name9)
GMOCK_INTERNAL_DECL_TYPE_AND_0_VALUE_PARAMS()
GMOCK_INTERNAL_DECL_TYPE_AND_1_VALUE_PARAMS(p0)
GMOCK_INTERNAL_DECL_TYPE_AND_2_VALUE_PARAMS(p0, p1)
GMOCK_INTERNAL_DECL_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2)
GMOCK_INTERNAL_DECL_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3)
GMOCK_INTERNAL_DECL_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)
GMOCK_INTERNAL_DECL_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)
GMOCK_INTERNAL_DECL_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)
GMOCK_INTERNAL_DECL_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)
GMOCK_INTERNAL_DECL_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)
GMOCK_INTERNAL_DECL_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)
GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()
GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)
GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)
GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)
GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)
GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)
GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)
GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)
GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)
GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)
GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)
GMOCK_INTERNAL_DEFN_COPY_AND_0_VALUE_PARAMS()
GMOCK_INTERNAL_DEFN_COPY_AND_1_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_2_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_3_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_4_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_5_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_6_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_7_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_8_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_9_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_COPY_AND_10_VALUE_PARAMS(...)
GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS()
GMOCK_INTERNAL_DEFN_AND_1_VALUE_PARAMS(p0)
GMOCK_INTERNAL_DEFN_AND_2_VALUE_PARAMS(p0, p1)
GMOCK_INTERNAL_DEFN_AND_3_VALUE_PARAMS(p0, p1, p2)
GMOCK_INTERNAL_DEFN_AND_4_VALUE_PARAMS(p0, p1, p2, p3)
GMOCK_INTERNAL_DEFN_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)
GMOCK_INTERNAL_DEFN_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)
GMOCK_INTERNAL_DEFN_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)
GMOCK_INTERNAL_DEFN_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)
GMOCK_INTERNAL_DEFN_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)
GMOCK_INTERNAL_DEFN_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)
GMOCK_INTERNAL_LIST_AND_0_VALUE_PARAMS()
GMOCK_INTERNAL_LIST_AND_1_VALUE_PARAMS(p0)
GMOCK_INTERNAL_LIST_AND_2_VALUE_PARAMS(p0, p1)
GMOCK_INTERNAL_LIST_AND_3_VALUE_PARAMS(p0, p1, p2)
GMOCK_INTERNAL_LIST_AND_4_VALUE_PARAMS(p0, p1, p2, p3)
GMOCK_INTERNAL_LIST_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)
GMOCK_INTERNAL_LIST_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)
GMOCK_INTERNAL_LIST_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)
GMOCK_INTERNAL_LIST_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)
GMOCK_INTERNAL_LIST_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)
GMOCK_INTERNAL_LIST_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)
GMOCK_INTERNAL_LIST_TYPE_AND_0_VALUE_PARAMS()
GMOCK_INTERNAL_LIST_TYPE_AND_1_VALUE_PARAMS(p0)
GMOCK_INTERNAL_LIST_TYPE_AND_2_VALUE_PARAMS(p0, p1)
GMOCK_INTERNAL_LIST_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2)
GMOCK_INTERNAL_LIST_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3)
GMOCK_INTERNAL_LIST_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)
GMOCK_INTERNAL_LIST_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)
GMOCK_INTERNAL_LIST_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)
GMOCK_INTERNAL_LIST_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)
GMOCK_INTERNAL_LIST_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)
GMOCK_INTERNAL_LIST_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)
GMOCK_INTERNAL_DECL_AND_0_VALUE_PARAMS()
GMOCK_INTERNAL_DECL_AND_1_VALUE_PARAMS(p0)
GMOCK_INTERNAL_DECL_AND_2_VALUE_PARAMS(p0, p1)
GMOCK_INTERNAL_DECL_AND_3_VALUE_PARAMS(p0, p1, p2)
GMOCK_INTERNAL_DECL_AND_4_VALUE_PARAMS(p0, p1, p2, p3)
GMOCK_INTERNAL_DECL_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)
GMOCK_INTERNAL_DECL_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)
GMOCK_INTERNAL_DECL_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)
GMOCK_INTERNAL_DECL_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)
GMOCK_INTERNAL_DECL_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)
GMOCK_INTERNAL_DECL_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)
GMOCK_INTERNAL_COUNT_AND_0_VALUE_PARAMS()
GMOCK_INTERNAL_COUNT_AND_1_VALUE_PARAMS(p0)
GMOCK_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1)
GMOCK_INTERNAL_COUNT_AND_3_VALUE_PARAMS(p0, p1, p2)
GMOCK_INTERNAL_COUNT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)
GMOCK_INTERNAL_COUNT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)
GMOCK_INTERNAL_COUNT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)
GMOCK_INTERNAL_COUNT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)
GMOCK_INTERNAL_COUNT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)
GMOCK_INTERNAL_COUNT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)
GMOCK_INTERNAL_COUNT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)
GMOCK_ACTION_CLASS_(name, value_params)
ACTION_TEMPLATE(name, template_params, value_params)
file gmock-more-matchers.h
#include “gmock/gmock-matchers.h”
file gmock-more-matchers.h
#include “gmock/gmock-matchers.h”
file gmock-nice-strict.h
#include <type_traits>#include “gmock/gmock-spec-builders.h”#include “gmock/internal/gmock-port.h”

Defines

GTEST_INTERNAL_EMPTY_BASE_CLASS
file gmock-nice-strict.h
#include <type_traits>#include “gmock/gmock-spec-builders.h”#include “gmock/internal/gmock-port.h”

Defines

GTEST_INTERNAL_EMPTY_BASE_CLASS
file gmock-spec-builders.h
#include <functional>#include <map>#include <memory>#include <set>#include <sstream>#include <string>#include <type_traits>#include <utility>#include <vector>#include “gmock/gmock-actions.h”#include “gmock/gmock-cardinalities.h”#include “gmock/gmock-matchers.h”#include “gmock/internal/gmock-internal-utils.h”#include “gmock/internal/gmock-port.h”#include “gtest/gtest.h”

Defines

GMOCK_ON_CALL_IMPL_(mock_expr, Setter, call)
ON_CALL(obj, call)
EXPECT_CALL(obj, call)

Functions

GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251) namespace testing
file gmock-spec-builders.h
#include <functional>#include <map>#include <memory>#include <set>#include <sstream>#include <string>#include <type_traits>#include <utility>#include <vector>#include “gmock/gmock-actions.h”#include “gmock/gmock-cardinalities.h”#include “gmock/gmock-matchers.h”#include “gmock/internal/gmock-internal-utils.h”#include “gmock/internal/gmock-port.h”#include “gtest/gtest.h”

Defines

GMOCK_ON_CALL_IMPL_(mock_expr, Setter, call)
ON_CALL(obj, call)
EXPECT_CALL(obj, call)

Functions

GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251) namespace testing
file gmock.h
#include “gmock/gmock-actions.h”#include “gmock/gmock-cardinalities.h”#include “gmock/gmock-function-mocker.h”#include “gmock/gmock-matchers.h”#include “gmock/gmock-more-actions.h”#include “gmock/gmock-more-matchers.h”#include “gmock/gmock-nice-strict.h”#include “gmock/internal/gmock-internal-utils.h”
file gmock.h
#include “gmock/gmock-actions.h”#include “gmock/gmock-cardinalities.h”#include “gmock/gmock-function-mocker.h”#include “gmock/gmock-matchers.h”#include “gmock/gmock-more-actions.h”#include “gmock/gmock-more-matchers.h”#include “gmock/gmock-nice-strict.h”#include “gmock/internal/gmock-internal-utils.h”
file gtest-death-test.h
#include “gtest/internal/gtest-death-test-internal.h”

Defines

GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, terminator)
EXPECT_DEATH_IF_SUPPORTED(statement, regex)
ASSERT_DEATH_IF_SUPPORTED(statement, regex)
file gtest-death-test.h
#include “gtest/internal/gtest-death-test-internal.h”

Defines

GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, terminator)
EXPECT_DEATH_IF_SUPPORTED(statement, regex)
ASSERT_DEATH_IF_SUPPORTED(statement, regex)
file gtest-matchers.h
#include <atomic>#include <memory>#include <ostream>#include <string>#include <type_traits>#include “gtest/gtest-printers.h”#include “gtest/internal/gtest-internal.h”#include “gtest/internal/gtest-port.h”

Defines

GTEST_MAYBE_5046_

Functions

GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251 GTEST_MAYBE_5046_) namespace testing
file gtest-matchers.h
#include <atomic>#include <memory>#include <ostream>#include <string>#include <type_traits>#include “gtest/gtest-printers.h”#include “gtest/internal/gtest-internal.h”#include “gtest/internal/gtest-port.h”

Defines

GTEST_MAYBE_5046_

Functions

GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251 GTEST_MAYBE_5046_) namespace testing
file gtest-message.h
#include <limits>#include <memory>#include <sstream>#include “gtest/internal/gtest-port.h”
file gtest-message.h
#include <limits>#include <memory>#include <sstream>#include “gtest/internal/gtest-port.h”
file gtest-param-test.h
#include <iterator>#include <utility>#include “gtest/internal/gtest-internal.h”#include “gtest/internal/gtest-param-util.h”#include “gtest/internal/gtest-port.h”

Defines

TEST_P(test_suite_name, test_name)
GTEST_EXPAND_(arg)
GTEST_GET_FIRST_(first, ...)
GTEST_GET_SECOND_(first, second, ...)
INSTANTIATE_TEST_SUITE_P(prefix, test_suite_name, ...)
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(T)
INSTANTIATE_TEST_CASE_P
file gtest-param-test.h
#include <iterator>#include <utility>#include “gtest/internal/gtest-internal.h”#include “gtest/internal/gtest-param-util.h”#include “gtest/internal/gtest-port.h”

Defines

TEST_P(test_suite_name, test_name)
GTEST_EXPAND_(arg)
GTEST_GET_FIRST_(first, ...)
GTEST_GET_SECOND_(first, second, ...)
INSTANTIATE_TEST_SUITE_P(prefix, test_suite_name, ...)
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(T)
INSTANTIATE_TEST_CASE_P
file gtest-printers.h
#include <functional>#include <memory>#include <ostream>#include <sstream>#include <string>#include <tuple>#include <type_traits>#include <utility>#include <vector>#include “gtest/internal/gtest-internal.h”#include “gtest/internal/gtest-port.h”#include “gtest/internal/custom/gtest-printers.h”

Defines

GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)
GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType)
file gtest-printers.h
#include <functional>#include <memory>#include <ostream>#include <sstream>#include <string>#include <tuple>#include <type_traits>#include <utility>#include <vector>#include “gtest/internal/gtest-internal.h”#include “gtest/internal/gtest-port.h”#include “gtest/internal/custom/gtest-printers.h”

Defines

GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)
GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType)
file gtest-spi.h
#include “gtest/gtest.h”

Defines

EXPECT_FATAL_FAILURE(statement, substr)
EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr)
EXPECT_NONFATAL_FAILURE(statement, substr)
EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr)

Functions

GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251) namespace testing
file gtest-spi.h
#include “gtest/gtest.h”

Defines

EXPECT_FATAL_FAILURE(statement, substr)
EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr)
EXPECT_NONFATAL_FAILURE(statement, substr)
EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr)

Functions

GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251) namespace testing
file gtest-test-part.h
#include <iosfwd>#include <vector>#include “gtest/internal/gtest-internal.h”#include “gtest/internal/gtest-string.h”

Functions

GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251) namespace testing
file gtest-test-part.h
#include <iosfwd>#include <vector>#include “gtest/internal/gtest-internal.h”#include “gtest/internal/gtest-string.h”

Functions

GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251) namespace testing
file gtest-typed-test.h
#include “gtest/internal/gtest-internal.h”#include “gtest/internal/gtest-port.h”#include “gtest/internal/gtest-type-util.h”

Defines

GTEST_TYPE_PARAMS_(TestSuiteName)
GTEST_NAME_GENERATOR_(TestSuiteName)
TYPED_TEST_SUITE(CaseName, Types, ...)
TYPED_TEST(CaseName, TestName)
TYPED_TEST_CASE
GTEST_SUITE_NAMESPACE_(TestSuiteName)
GTEST_TYPED_TEST_SUITE_P_STATE_(TestSuiteName)
GTEST_REGISTERED_TEST_NAMES_(TestSuiteName)
TYPED_TEST_SUITE_P(SuiteName)
TYPED_TEST_CASE_P
TYPED_TEST_P(SuiteName, TestName)
REGISTER_TYPED_TEST_SUITE_P(SuiteName, ...)
REGISTER_TYPED_TEST_CASE_P
INSTANTIATE_TYPED_TEST_SUITE_P(Prefix, SuiteName, Types, ...)
INSTANTIATE_TYPED_TEST_CASE_P
file gtest-typed-test.h
#include “gtest/internal/gtest-internal.h”#include “gtest/internal/gtest-port.h”#include “gtest/internal/gtest-type-util.h”

Defines

GTEST_TYPE_PARAMS_(TestSuiteName)
GTEST_NAME_GENERATOR_(TestSuiteName)
TYPED_TEST_SUITE(CaseName, Types, ...)
TYPED_TEST(CaseName, TestName)
TYPED_TEST_CASE
GTEST_SUITE_NAMESPACE_(TestSuiteName)
GTEST_TYPED_TEST_SUITE_P_STATE_(TestSuiteName)
GTEST_REGISTERED_TEST_NAMES_(TestSuiteName)
TYPED_TEST_SUITE_P(SuiteName)
TYPED_TEST_CASE_P
TYPED_TEST_P(SuiteName, TestName)
REGISTER_TYPED_TEST_SUITE_P(SuiteName, ...)
REGISTER_TYPED_TEST_CASE_P
INSTANTIATE_TYPED_TEST_SUITE_P(Prefix, SuiteName, Types, ...)
INSTANTIATE_TYPED_TEST_CASE_P
file gtest.h
#include <cstddef>#include <limits>#include <memory>#include <ostream>#include <type_traits>#include <vector>#include “gtest/internal/gtest-internal.h”#include “gtest/internal/gtest-string.h”#include “gtest/gtest-death-test.h”#include “gtest/gtest-matchers.h”#include “gtest/gtest-message.h”#include “gtest/gtest-param-test.h”#include “gtest/gtest-printers.h”#include “gtest/gtest_prod.h”#include “gtest/gtest-test-part.h”#include “gtest/gtest-typed-test.h”#include “gtest/gtest_pred_impl.h”

Defines

GTEST_IMPL_CMP_HELPER_(op_name, op)
GTEST_SKIP()
ADD_FAILURE()
ADD_FAILURE_AT(file, line)
GTEST_FAIL()
GTEST_FAIL_AT(file, line)
FAIL()
GTEST_SUCCEED()
SUCCEED()
EXPECT_THROW(statement, expected_exception)
EXPECT_NO_THROW(statement)
EXPECT_ANY_THROW(statement)
ASSERT_THROW(statement, expected_exception)
ASSERT_NO_THROW(statement)
ASSERT_ANY_THROW(statement)
GTEST_EXPECT_TRUE(condition)
GTEST_EXPECT_FALSE(condition)
GTEST_ASSERT_TRUE(condition)
GTEST_ASSERT_FALSE(condition)
EXPECT_TRUE(condition)
EXPECT_FALSE(condition)
ASSERT_TRUE(condition)
ASSERT_FALSE(condition)
EXPECT_EQ(val1, val2)
EXPECT_NE(val1, val2)
EXPECT_LE(val1, val2)
EXPECT_LT(val1, val2)
EXPECT_GE(val1, val2)
EXPECT_GT(val1, val2)
GTEST_ASSERT_EQ(val1, val2)
GTEST_ASSERT_NE(val1, val2)
GTEST_ASSERT_LE(val1, val2)
GTEST_ASSERT_LT(val1, val2)
GTEST_ASSERT_GE(val1, val2)
GTEST_ASSERT_GT(val1, val2)
ASSERT_EQ(val1, val2)
ASSERT_NE(val1, val2)
ASSERT_LE(val1, val2)
ASSERT_LT(val1, val2)
ASSERT_GE(val1, val2)
ASSERT_GT(val1, val2)
EXPECT_STREQ(s1, s2)
EXPECT_STRNE(s1, s2)
EXPECT_STRCASEEQ(s1, s2)
EXPECT_STRCASENE(s1, s2)
ASSERT_STREQ(s1, s2)
ASSERT_STRNE(s1, s2)
ASSERT_STRCASEEQ(s1, s2)
ASSERT_STRCASENE(s1, s2)
EXPECT_FLOAT_EQ(val1, val2)
EXPECT_DOUBLE_EQ(val1, val2)
ASSERT_FLOAT_EQ(val1, val2)
ASSERT_DOUBLE_EQ(val1, val2)
EXPECT_NEAR(val1, val2, abs_error)
ASSERT_NEAR(val1, val2, abs_error)
ASSERT_NO_FATAL_FAILURE(statement)
EXPECT_NO_FATAL_FAILURE(statement)
SCOPED_TRACE(message)
GTEST_TEST(test_suite_name, test_name)
TEST(test_suite_name, test_name)
TEST_F(test_fixture, test_name)

Functions

GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251) namespace testing
inline int RUN_ALL_TESTS () GTEST_MUST_USE_RESULT_
file gtest.h
#include <cstddef>#include <limits>#include <memory>#include <ostream>#include <type_traits>#include <vector>#include “gtest/internal/gtest-internal.h”#include “gtest/internal/gtest-string.h”#include “gtest/gtest-death-test.h”#include “gtest/gtest-matchers.h”#include “gtest/gtest-message.h”#include “gtest/gtest-param-test.h”#include “gtest/gtest-printers.h”#include “gtest/gtest_prod.h”#include “gtest/gtest-test-part.h”#include “gtest/gtest-typed-test.h”#include “gtest/gtest_pred_impl.h”

Defines

GTEST_IMPL_CMP_HELPER_(op_name, op)
GTEST_SKIP()
ADD_FAILURE()
ADD_FAILURE_AT(file, line)
GTEST_FAIL()
GTEST_FAIL_AT(file, line)
FAIL()
GTEST_SUCCEED()
SUCCEED()
EXPECT_THROW(statement, expected_exception)
EXPECT_NO_THROW(statement)
EXPECT_ANY_THROW(statement)
ASSERT_THROW(statement, expected_exception)
ASSERT_NO_THROW(statement)
ASSERT_ANY_THROW(statement)
GTEST_EXPECT_TRUE(condition)
GTEST_EXPECT_FALSE(condition)
GTEST_ASSERT_TRUE(condition)
GTEST_ASSERT_FALSE(condition)
EXPECT_TRUE(condition)
EXPECT_FALSE(condition)
ASSERT_TRUE(condition)
ASSERT_FALSE(condition)
EXPECT_EQ(val1, val2)
EXPECT_NE(val1, val2)
EXPECT_LE(val1, val2)
EXPECT_LT(val1, val2)
EXPECT_GE(val1, val2)
EXPECT_GT(val1, val2)
GTEST_ASSERT_EQ(val1, val2)
GTEST_ASSERT_NE(val1, val2)
GTEST_ASSERT_LE(val1, val2)
GTEST_ASSERT_LT(val1, val2)
GTEST_ASSERT_GE(val1, val2)
GTEST_ASSERT_GT(val1, val2)
ASSERT_EQ(val1, val2)
ASSERT_NE(val1, val2)
ASSERT_LE(val1, val2)
ASSERT_LT(val1, val2)
ASSERT_GE(val1, val2)
ASSERT_GT(val1, val2)
EXPECT_STREQ(s1, s2)
EXPECT_STRNE(s1, s2)
EXPECT_STRCASEEQ(s1, s2)
EXPECT_STRCASENE(s1, s2)
ASSERT_STREQ(s1, s2)
ASSERT_STRNE(s1, s2)
ASSERT_STRCASEEQ(s1, s2)
ASSERT_STRCASENE(s1, s2)
EXPECT_FLOAT_EQ(val1, val2)
EXPECT_DOUBLE_EQ(val1, val2)
ASSERT_FLOAT_EQ(val1, val2)
ASSERT_DOUBLE_EQ(val1, val2)
EXPECT_NEAR(val1, val2, abs_error)
ASSERT_NEAR(val1, val2, abs_error)
ASSERT_NO_FATAL_FAILURE(statement)
EXPECT_NO_FATAL_FAILURE(statement)
SCOPED_TRACE(message)
GTEST_TEST(test_suite_name, test_name)
TEST(test_suite_name, test_name)
TEST_F(test_fixture, test_name)

Functions

GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251) namespace testing
int RUN_ALL_TESTS () GTEST_MUST_USE_RESULT_
file gtest_pred_impl.h
#include “gtest/gtest.h”

Defines

GTEST_ASSERT_(expression, on_failure)
GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)
GTEST_PRED1_(pred, v1, on_failure)
EXPECT_PRED_FORMAT1(pred_format, v1)
EXPECT_PRED1(pred, v1)
ASSERT_PRED_FORMAT1(pred_format, v1)
ASSERT_PRED1(pred, v1)
GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)
GTEST_PRED2_(pred, v1, v2, on_failure)
EXPECT_PRED_FORMAT2(pred_format, v1, v2)
EXPECT_PRED2(pred, v1, v2)
ASSERT_PRED_FORMAT2(pred_format, v1, v2)
ASSERT_PRED2(pred, v1, v2)
GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)
GTEST_PRED3_(pred, v1, v2, v3, on_failure)
EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3)
EXPECT_PRED3(pred, v1, v2, v3)
ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3)
ASSERT_PRED3(pred, v1, v2, v3)
GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)
GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)
EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4)
EXPECT_PRED4(pred, v1, v2, v3, v4)
ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4)
ASSERT_PRED4(pred, v1, v2, v3, v4)
GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)
GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)
EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5)
EXPECT_PRED5(pred, v1, v2, v3, v4, v5)
ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5)
ASSERT_PRED5(pred, v1, v2, v3, v4, v5)
file gtest_pred_impl.h
#include “gtest/gtest.h”

Defines

GTEST_ASSERT_(expression, on_failure)
GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)
GTEST_PRED1_(pred, v1, on_failure)
EXPECT_PRED_FORMAT1(pred_format, v1)
EXPECT_PRED1(pred, v1)
ASSERT_PRED_FORMAT1(pred_format, v1)
ASSERT_PRED1(pred, v1)
GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)
GTEST_PRED2_(pred, v1, v2, on_failure)
EXPECT_PRED_FORMAT2(pred_format, v1, v2)
EXPECT_PRED2(pred, v1, v2)
ASSERT_PRED_FORMAT2(pred_format, v1, v2)
ASSERT_PRED2(pred, v1, v2)
GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)
GTEST_PRED3_(pred, v1, v2, v3, on_failure)
EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3)
EXPECT_PRED3(pred, v1, v2, v3)
ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3)
ASSERT_PRED3(pred, v1, v2, v3)
GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)
GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)
EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4)
EXPECT_PRED4(pred, v1, v2, v3, v4)
ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4)
ASSERT_PRED4(pred, v1, v2, v3, v4)
GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)
GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)
EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5)
EXPECT_PRED5(pred, v1, v2, v3, v4, v5)
ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5)
ASSERT_PRED5(pred, v1, v2, v3, v4, v5)
file gtest_prod.h

Defines

FRIEND_TEST(test_case_name, test_name)
file gtest_prod.h

Defines

FRIEND_TEST(test_case_name, test_name)
file attr.h
#include “cast.h”

Typedefs

using is_call_guard = is_instantiation<call_guard, T>
using extract_guard_t = typename exactly_one_t<is_call_guard, call_guard<>, Extra...>::type

Extract the type from the first call_guard in Extras... (or void_type if none found)

Functions

inline void keep_alive_impl(size_t Nurse, size_t Patient, function_call &call, handle ret)
template<typename ...Extra, size_t named = constexpr_sum(std::is_base_of<arg, Extra>::value...), size_t self = constexpr_sum(std::is_same<is_method, Extra>::value...)>
constexpr bool expected_num_args(size_t nargs, bool has_args, bool has_kwargs)

Check the number of named arguments at compile time.

file attr.h
#include “cast.h”

Typedefs

using is_call_guard = is_instantiation<call_guard, T>
using extract_guard_t = typename exactly_one_t<is_call_guard, call_guard<>, Extra...>::type

Extract the type from the first call_guard in Extras... (or void_type if none found)

Functions

inline void keep_alive_impl(size_t Nurse, size_t Patient, function_call &call, handle ret)
template<typename ...Extra, size_t named = constexpr_sum(std::is_base_of<arg, Extra>::value...), size_t self = constexpr_sum(std::is_same<is_method, Extra>::value...)>
constexpr bool expected_num_args(size_t nargs, bool has_args, bool has_kwargs)

Check the number of named arguments at compile time.

file buffer_info.h
#include “detail/common.h”
file buffer_info.h
#include “detail/common.h”
file cast.h
#include “pytypes.h”#include “detail/typeid.h”#include “detail/descr.h”#include “detail/internals.h”#include <array>#include <limits>#include <tuple>#include <type_traits>

Defines

PYBIND11_TYPE_CASTER(type, py_name)
PYBIND11_DECLARE_HOLDER_TYPE(type, holder_type, ...)

Create a specialization for custom holder types (silently ignores std::shared_ptr)

PYBIND11_MAKE_OPAQUE(...)
PYBIND11_TYPE(...)

Lets you pass a type containing a , through a macro parameter without needing a separate typedef, e.g.

: PYBIND11_OVERLOAD(PYBIND11_TYPE(ReturnType<A, B>), PYBIND11_TYPE(Parent<C, D>), f, arg)

Typedefs

using cast_op_type = conditional_t<std::is_pointer<remove_reference_t<T>>::value, typename std::add_pointer<intrinsic_t<T>>::type, typename std::add_lvalue_reference<intrinsic_t<T>>::type>

Determine suitable casting operator for pointer-or-lvalue-casting type casters.

The type caster needs to provide operator T*() and operator T&() operators.

If the type supports moving the value away via an operator T&&() && method, it should use movable_cast_op_type instead.

using movable_cast_op_type = conditional_t<std::is_pointer<typename std::remove_reference<T>::type>::value, typename std::add_pointer<intrinsic_t<T>>::type, conditional_t<std::is_rvalue_reference<T>::value, typename std::add_rvalue_reference<intrinsic_t<T>>::type, typename std::add_lvalue_reference<intrinsic_t<T>>::type>>

Determine suitable casting operator for a type caster with a movable value.

Such a type caster needs to provide operator T*(), operator T&(), and operator T&&() &&. The latter will be called in appropriate contexts where the value can be moved rather than copied.

These operator are automatically provided when using the PYBIND11_TYPE_CASTER macro.

using make_caster = type_caster<intrinsic_t<type>>
using is_std_char_type = any_of<std::is_same<CharT, char>, std::is_same<CharT, char16_t>, std::is_same<CharT, char32_t>, std::is_same<CharT, wchar_t>>
using type_caster_holder = conditional_t<is_copy_constructible<holder_type>::value, copyable_holder_caster<type, holder_type>, move_only_holder_caster<type, holder_type>>
using move_is_plain_type = satisfies_none_of<T, std::is_void, std::is_pointer, std::is_reference, std::is_const>
using move_never = none_of<move_always<T>, move_if_unreferenced<T>>
using cast_is_temporary_value_reference = bool_constant<(std::is_reference<type>::value || std::is_pointer<type>::value) && !std::is_base_of<type_caster_generic, make_caster<type>>::value && !std::is_same<intrinsic_t<type>, void>::value>
using overload_caster_t = conditional_t<cast_is_temporary_value_reference<ret_type>::value, make_caster<ret_type>, overload_unused>
using arg_t = arg_v

Alias for backward compatibility to be removed in version 2.0.

Functions

inline std::pair< decltype(internals::registered_types_py)::iterator, bool > all_type_info_get_cache (PyTypeObject *type)
inline PYBIND11_NOINLINE void all_type_info_populate (PyTypeObject *t, std::vector< type_info *> &bases)
inline const std::vector<detail::type_info*> &all_type_info(PyTypeObject *type)

Extracts vector of type_info pointers of pybind-registered roots of the given Python type.

Will be just 1 pybind type for the Python type of a pybind-registered class, or for any Python-side derived class that uses single inheritance. Will contain as many types as required for a Python class that uses multiple inheritance to inherit (directly or indirectly) from multiple pybind-registered classes. Will be empty if neither the type nor any base classes are pybind-registered.

The value is cached for the lifetime of the Python type.

inline PYBIND11_NOINLINE detail::type_info * get_type_info (PyTypeObject *type)

Gets a single pybind11 type info for a python type.

Returns nullptr if neither the type nor any ancestors are pybind11-registered. Throws an exception if there are multiple basesuse all_type_info instead if you want to support multiple bases.

inline detail::type_info *get_local_type_info(const std::type_index &tp)
inline detail::type_info *get_global_type_info(const std::type_index &tp)
inline PYBIND11_NOINLINE detail::type_info * get_type_info (const std::type_index &tp, bool throw_if_missing=false)

Return the type info for a given C++ type; on lookup failure can either throw or return nullptr.

inline PYBIND11_NOINLINE handle get_type_handle (const std::type_info &tp, bool throw_if_missing)
inline PYBIND11_NOINLINE bool isinstance_generic (handle obj, const std::type_info &tp)
inline PYBIND11_NOINLINE std::string error_string ()
inline PYBIND11_NOINLINE handle get_object_handle (const void *ptr, const detail::type_info *type)
inline PyThreadState *get_thread_state_unchecked()
inline void keep_alive_impl(handle nurse, handle patient)
inline PyObject *make_new_instance(PyTypeObject *type)

Instance creation function for all pybind11 types.

It allocates the internal instance layout for holding C++ objects and holders. Allocation is done lazily (the first time the instance is cast to a reference or pointer), and initialization is done by an __init__ function.

template<typename T>
make_caster<T>::template cast_op_type<T> cast_op(make_caster<T> &caster)
template<typename T>
make_caster<T>::template cast_op_type<typename std::add_rvalue_reference<T>::type> cast_op(make_caster<T> &&caster)
template<typename T, typename SFINAE>
type_caster<T, SFINAE> &load_type(type_caster<T, SFINAE> &conv, const handle &handle)
template<typename T>
make_caster<T> load_type(const handle &handle)
template<typename T, detail::enable_if_t<!detail::is_pyobject<T>::value, int> = 0>
T cast(const handle &handle)
template<typename T, detail::enable_if_t<!detail::is_pyobject<T>::value, int> = 0>
object cast(const T &value, return_value_policy policy = return_value_policy::automatic_reference, handle parent = handle())
template<typename T>
detail::enable_if_t<!detail::move_never<T>::value, T> move(object &&obj)
template<typename T>
detail::enable_if_t<detail::move_always<T>::value, T> cast(object &&object)
template<typename T>
detail::enable_if_t<detail::move_if_unreferenced<T>::value, T> cast(object &&object)
template<typename T>
detail::enable_if_t<detail::move_never<T>::value, T> cast(object &&object)
template<typename T, enable_if_t<!is_pyobject<T>::value, int>>
object object_or_cast(T &&o)
template<typename T>
enable_if_t<cast_is_temporary_value_reference<T>::value, T> cast_ref(object &&o, make_caster<T> &caster)
template<typename T>
enable_if_t<!cast_is_temporary_value_reference<T>::value, T> cast_ref(object&&, overload_unused&)
template<typename T>
enable_if_t<!cast_is_temporary_value_reference<T>::value, T> cast_safe(object &&o)
template<typename T>
enable_if_t<cast_is_temporary_value_reference<T>::value, T> cast_safe(object&&)
template<>
inline void cast_safe<void>(object&&)
template<return_value_policy policy = return_value_policy::automatic_reference>
tuple make_tuple()
template<return_value_policy policy = return_value_policy::automatic_reference, typename ...Args>
tuple make_tuple(Args&&... args_)
template<return_value_policy policy, typename ...Args, typename = enable_if_t<all_of<is_positional<Args>...>::value>>
simple_collector<policy> collect_arguments(Args&&... args)

Collect only positional arguments for a Python function call.

template<return_value_policy policy, typename ...Args, typename = enable_if_t<!all_of<is_positional<Args>...>::value>>
unpacking_collector<policy> collect_arguments(Args&&... args)

Collect all arguments, including keywords and unpacking (only instantiated when needed)

file cast.h
#include “pytypes.h”#include “detail/typeid.h”#include “detail/descr.h”#include “detail/internals.h”#include <array>#include <limits>#include <tuple>#include <type_traits>

Defines

PYBIND11_TYPE_CASTER(type, py_name)
PYBIND11_DECLARE_HOLDER_TYPE(type, holder_type, ...)

Create a specialization for custom holder types (silently ignores std::shared_ptr)

PYBIND11_MAKE_OPAQUE(...)
PYBIND11_TYPE(...)

Lets you pass a type containing a , through a macro parameter without needing a separate typedef, e.g.

: PYBIND11_OVERLOAD(PYBIND11_TYPE(ReturnType<A, B>), PYBIND11_TYPE(Parent<C, D>), f, arg)

Typedefs

using cast_op_type = conditional_t<std::is_pointer<remove_reference_t<T>>::value, typename std::add_pointer<intrinsic_t<T>>::type, typename std::add_lvalue_reference<intrinsic_t<T>>::type>

Determine suitable casting operator for pointer-or-lvalue-casting type casters.

The type caster needs to provide operator T*() and operator T&() operators.

If the type supports moving the value away via an operator T&&() && method, it should use movable_cast_op_type instead.

using movable_cast_op_type = conditional_t<std::is_pointer<typename std::remove_reference<T>::type>::value, typename std::add_pointer<intrinsic_t<T>>::type, conditional_t<std::is_rvalue_reference<T>::value, typename std::add_rvalue_reference<intrinsic_t<T>>::type, typename std::add_lvalue_reference<intrinsic_t<T>>::type>>

Determine suitable casting operator for a type caster with a movable value.

Such a type caster needs to provide operator T*(), operator T&(), and operator T&&() &&. The latter will be called in appropriate contexts where the value can be moved rather than copied.

These operator are automatically provided when using the PYBIND11_TYPE_CASTER macro.

using make_caster = type_caster<intrinsic_t<type>>
using is_std_char_type = any_of<std::is_same<CharT, char>, std::is_same<CharT, char16_t>, std::is_same<CharT, char32_t>, std::is_same<CharT, wchar_t>>
using type_caster_holder = conditional_t<is_copy_constructible<holder_type>::value, copyable_holder_caster<type, holder_type>, move_only_holder_caster<type, holder_type>>
using move_is_plain_type = satisfies_none_of<T, std::is_void, std::is_pointer, std::is_reference, std::is_const>
using move_never = none_of<move_always<T>, move_if_unreferenced<T>>
using cast_is_temporary_value_reference = bool_constant<(std::is_reference<type>::value || std::is_pointer<type>::value) && !std::is_base_of<type_caster_generic, make_caster<type>>::value && !std::is_same<intrinsic_t<type>, void>::value>
using overload_caster_t = conditional_t<cast_is_temporary_value_reference<ret_type>::value, make_caster<ret_type>, overload_unused>
using arg_t = arg_v

Alias for backward compatibility to be removed in version 2.0.

Functions

inline std::pair< decltype(internals::registered_types_py)::iterator, bool > all_type_info_get_cache (PyTypeObject *type)
inline PYBIND11_NOINLINE void all_type_info_populate (PyTypeObject *t, std::vector< type_info *> &bases)
inline const std::vector<detail::type_info*> &all_type_info(PyTypeObject *type)

Extracts vector of type_info pointers of pybind-registered roots of the given Python type.

Will be just 1 pybind type for the Python type of a pybind-registered class, or for any Python-side derived class that uses single inheritance. Will contain as many types as required for a Python class that uses multiple inheritance to inherit (directly or indirectly) from multiple pybind-registered classes. Will be empty if neither the type nor any base classes are pybind-registered.

The value is cached for the lifetime of the Python type.

inline PYBIND11_NOINLINE detail::type_info * get_type_info (PyTypeObject *type)

Gets a single pybind11 type info for a python type.

Returns nullptr if neither the type nor any ancestors are pybind11-registered. Throws an exception if there are multiple basesuse all_type_info instead if you want to support multiple bases.

inline detail::type_info *get_local_type_info(const std::type_index &tp)
inline detail::type_info *get_global_type_info(const std::type_index &tp)
inline PYBIND11_NOINLINE detail::type_info * get_type_info (const std::type_index &tp, bool throw_if_missing=false)

Return the type info for a given C++ type; on lookup failure can either throw or return nullptr.

inline PYBIND11_NOINLINE handle get_type_handle (const std::type_info &tp, bool throw_if_missing)
inline PYBIND11_NOINLINE bool isinstance_generic (handle obj, const std::type_info &tp)
inline PYBIND11_NOINLINE std::string error_string ()
inline PYBIND11_NOINLINE handle get_object_handle (const void *ptr, const detail::type_info *type)
inline PyThreadState *get_thread_state_unchecked()
inline void keep_alive_impl(handle nurse, handle patient)
inline PyObject *make_new_instance(PyTypeObject *type)

Instance creation function for all pybind11 types.

It allocates the internal instance layout for holding C++ objects and holders. Allocation is done lazily (the first time the instance is cast to a reference or pointer), and initialization is done by an __init__ function.

template<typename T>
make_caster<T>::template cast_op_type<T> cast_op(make_caster<T> &caster)
template<typename T>
make_caster<T>::template cast_op_type<typename std::add_rvalue_reference<T>::type> cast_op(make_caster<T> &&caster)
template<typename T, typename SFINAE>
type_caster<T, SFINAE> &load_type(type_caster<T, SFINAE> &conv, const handle &handle)
template<typename T>
make_caster<T> load_type(const handle &handle)
template<typename T, detail::enable_if_t<!detail::is_pyobject<T>::value, int> = 0>
T cast(const handle &handle)
template<typename T, detail::enable_if_t<!detail::is_pyobject<T>::value, int> = 0>
object cast(const T &value, return_value_policy policy = return_value_policy::automatic_reference, handle parent = handle())
template<typename T>
detail::enable_if_t<!detail::move_never<T>::value, T> move(object &&obj)
template<typename T>
detail::enable_if_t<detail::move_always<T>::value, T> cast(object &&object)
template<typename T>
detail::enable_if_t<detail::move_if_unreferenced<T>::value, T> cast(object &&object)
template<typename T>
detail::enable_if_t<detail::move_never<T>::value, T> cast(object &&object)
template<typename T, enable_if_t<!is_pyobject<T>::value, int>>
object object_or_cast(T &&o)
template<typename T>
enable_if_t<cast_is_temporary_value_reference<T>::value, T> cast_ref(object &&o, make_caster<T> &caster)
template<typename T>
enable_if_t<!cast_is_temporary_value_reference<T>::value, T> cast_ref(object&&, overload_unused&)
template<typename T>
enable_if_t<!cast_is_temporary_value_reference<T>::value, T> cast_safe(object &&o)
template<typename T>
enable_if_t<cast_is_temporary_value_reference<T>::value, T> cast_safe(object&&)
template<>
inline void cast_safe<void>(object&&)
template<return_value_policy policy = return_value_policy::automatic_reference>
tuple make_tuple()
template<return_value_policy policy = return_value_policy::automatic_reference, typename ...Args>
tuple make_tuple(Args&&... args_)
template<return_value_policy policy, typename ...Args, typename = enable_if_t<all_of<is_positional<Args>...>::value>>
simple_collector<policy> collect_arguments(Args&&... args)

Collect only positional arguments for a Python function call.

template<return_value_policy policy, typename ...Args, typename = enable_if_t<!all_of<is_positional<Args>...>::value>>
unpacking_collector<policy> collect_arguments(Args&&... args)

Collect all arguments, including keywords and unpacking (only instantiated when needed)

file chrono.h
#include “pybind11.h”#include <cmath>#include <ctime>#include <chrono>#include <datetime.h>

Defines

PyDateTime_DELTA_GET_DAYS(o)
PyDateTime_DELTA_GET_SECONDS(o)
PyDateTime_DELTA_GET_MICROSECONDS(o)
file chrono.h
#include “pybind11.h”#include <cmath>#include <ctime>#include <chrono>#include <datetime.h>

Defines

PyDateTime_DELTA_GET_DAYS(o)
PyDateTime_DELTA_GET_SECONDS(o)
PyDateTime_DELTA_GET_MICROSECONDS(o)
file common.h
#include “detail/common.h”
file common.h
#include <Python.h>#include <frameobject.h>#include <pythread.h>#include <cstddef>#include <cstring>#include <forward_list>#include <vector>#include <string>#include <stdexcept>#include <unordered_set>#include <unordered_map>#include <memory>#include <typeindex>#include <type_traits>

Defines

NAMESPACE_BEGIN(name)
NAMESPACE_END(name)
PYBIND11_NAMESPACE
PYBIND11_EXPORT
PYBIND11_NOINLINE
PYBIND11_DEPRECATED(reason)
PYBIND11_VERSION_MAJOR
PYBIND11_VERSION_MINOR
PYBIND11_VERSION_PATCH
PYBIND11_INSTANCE_METHOD_NEW(ptr, class_)

Include Python header, disable linking to pythonX_d.lib on Windows in debug mode.

Compatibility macros for various Python versions

PYBIND11_INSTANCE_METHOD_CHECK
PYBIND11_INSTANCE_METHOD_GET_FUNCTION
PYBIND11_BYTES_CHECK
PYBIND11_BYTES_FROM_STRING
PYBIND11_BYTES_FROM_STRING_AND_SIZE
PYBIND11_BYTES_AS_STRING_AND_SIZE
PYBIND11_BYTES_AS_STRING
PYBIND11_BYTES_SIZE
PYBIND11_LONG_CHECK(o)
PYBIND11_LONG_AS_LONGLONG(o)
PYBIND11_LONG_FROM_SIGNED(o)
PYBIND11_LONG_FROM_UNSIGNED(o)
PYBIND11_BYTES_NAME
PYBIND11_STRING_NAME
PYBIND11_SLICE_OBJECT
PYBIND11_FROM_STRING
PYBIND11_STR_TYPE
PYBIND11_BOOL_ATTR
PYBIND11_NB_BOOL(ptr)
PYBIND11_PLUGIN_IMPL(name)
PYBIND11_TRY_NEXT_OVERLOAD
PYBIND11_STRINGIFY(x)
PYBIND11_TOSTRING(x)
PYBIND11_CONCAT(first, second)
PYBIND11_ENSURE_INTERNALS_READY
PYBIND11_CHECK_PYTHON_VERSION
PYBIND11_CATCH_INIT_EXCEPTIONS
PYBIND11_PLUGIN(name)

Deprecated in favor of PYBIND11_MODULE***

This macro creates the entry point that will be invoked when the Python interpreter imports a plugin library. Please create a module in the function body and return the pointer to its underlying Python object at the end.

.. code-block:: cpp

PYBIND11_PLUGIN(example) {
    pybind11::module m("example", "pybind11 example plugin");
/ Set up bindings here return m.ptr(); }

PYBIND11_MODULE(name, variable)

This macro creates the entry point that will be invoked when the Python interpreter imports an extension module.

The module name is given as the fist argument and it should not be in quotes. The second macro argument defines a variable of type py::module which can be used to initialize the module.

.. code-block:: cpp

PYBIND11_MODULE(example, m) {
    m.doc() = "pybind11 example module";

Add bindings here m.def(“foo”, []() { return “Hello, World!”; }); }

PYBIND11_EXPAND_SIDE_EFFECTS(PATTERN)
PYBIND11_RUNTIME_EXCEPTION(name, type)

Typedefs

using ssize_t = Py_ssize_t
using size_t = std::size_t
using enable_if_t = typename std::enable_if<B, T>::type

from cpp_future import (convenient aliases from C++14/17)

using conditional_t = typename std::conditional<B, T, F>::type
using remove_cv_t = typename std::remove_cv<T>::type
using remove_reference_t = typename std::remove_reference<T>::type
using make_index_sequence = typename make_index_sequence_impl<N>::type
using select_indices = typename select_indices_impl<index_sequence<>, 0, Bs...>::type
using bool_constant = std::integral_constant<bool, B>

Backports of std::bool_constant and std::negation to accommodate older compilers.

using void_t = typename void_t_impl<Ts...>::type
using all_of = std::is_same<bools<Ts::value..., true>, bools<true, Ts::value...>>
using any_of = negation<all_of<negation<Ts>...>>
using none_of = negation<any_of<Ts...>>
using satisfies_all_of = all_of<Predicates<T>...>
using satisfies_any_of = any_of<Predicates<T>...>
using satisfies_none_of = none_of<Predicates<T>...>
using intrinsic_t = typename intrinsic_type<T>::type
using exactly_one_t = typename exactly_one<Predicate, Default, Ts...>::type
using deferred_t = typename deferred_type<T, Us...>::type
using is_strict_base_of = bool_constant<std::is_base_of<Base, Derived>::value && !std::is_same<Base, Derived>::value>

Like is_base_of, but requires a strict base (i.e.

is_strict_base_of<T, T>value == false, unlike std::is_base_of)

using is_accessible_base_of = bool_constant<std::is_base_of<Base, Derived>::value && std::is_convertible<Derived*, Base*>::value>

Like is_base_of, but also requires that the base type is accessible (i.e.

that a Derived pointer can be converted to a Base pointer)

using is_template_base_of = decltype(is_template_base_of_impl<Base>::check((intrinsic_t<T>*)nullptr))

Check if a template is the base of a type.

For example: is_template_base_of<Base, T> is true if struct T : Base<U> {} where U can be anything

using is_shared_ptr = is_instantiation<std::shared_ptr, T>

Check if T is std::shared_ptr<U> where U can be anything.

using is_function_pointer = bool_constant<std::is_pointer<T>::value && std::is_function<typename std::remove_pointer<T>::type>::value>
using function_signature_t = conditional_t<std::is_function<F>::value, F, typename conditional_t<std::is_pointer<F>::value || std::is_member_pointer<F>::value, std::remove_pointer<F>, strip_function_object<F>>::type>
using is_lambda = satisfies_none_of<remove_reference_t<T>, std::is_function, std::is_pointer, std::is_member_pointer>

Returns true if the type looks like a lambda: that is, isn’t a function, pointer or member pointer.

Note that this can catch all sorts of other things, too; this is intended to be used in a place where passing a lambda makes sense.

using expand_side_effects = bool[]

Apply a function over each element of a parameter pack.

Enums

enum return_value_policy

Approach used to cast a previously unknown C++ instance into a Python object.

Values:

enumerator automatic

This is the default return value policy, which falls back to the policy return_value_policy::take_ownership when the return value is a pointer.

Otherwise, it uses return_value::move or return_value::copy for rvalue and lvalue references, respectively. See below for a description of what all of these different policies do.

enumerator automatic_reference

As above, but use policy return_value_policy::reference when the return value is a pointer.

This is the default conversion policy for function arguments when calling Python functions manually from C++ code (i.e. via handle::operator()). You probably won’t need to use this.

enumerator take_ownership

Reference an existing object (i.e.

do not create a new copy) and take ownership. Python will call the destructor and delete operator when the object’s reference count reaches zero. Undefined behavior ensues when the C++ side does the same..

enumerator copy

Create a new copy of the returned object, which will be owned by Python.

This policy is comparably safe because the lifetimes of the two instances are decoupled.

enumerator move

Use std::move to move the return value contents into a new instance that will be owned by Python.

This policy is comparably safe because the lifetimes of the two instances (move source and destination) are decoupled.

enumerator reference

Reference an existing object, but do not take ownership.

The C++ side is responsible for managing the object’s lifetime and deallocating it when it is no longer used. Warning: undefined behavior will ensue when the C++ side deletes an object that is still referenced and used by Python.

enumerator reference_internal

This policy only applies to methods and properties.

It references the object without taking ownership similar to the above return_value_policy::reference policy. In contrast to that policy, the function or property’s implicit this argument (called the parent) is considered to be the the owner of the return value (the child). pybind11 then couples the lifetime of the parent to the child via a reference relationship that ensures that the parent cannot be garbage collected while Python is still using the child. More advanced variations of this scheme are also possible using combinations of return_value_policy::reference and the keep_alive call policy

enumerator automatic

This is the default return value policy, which falls back to the policy return_value_policy::take_ownership when the return value is a pointer.

Otherwise, it uses return_value::move or return_value::copy for rvalue and lvalue references, respectively. See below for a description of what all of these different policies do.

enumerator automatic_reference

As above, but use policy return_value_policy::reference when the return value is a pointer.

This is the default conversion policy for function arguments when calling Python functions manually from C++ code (i.e. via handle::operator()). You probably won’t need to use this.

enumerator take_ownership

Reference an existing object (i.e.

do not create a new copy) and take ownership. Python will call the destructor and delete operator when the object’s reference count reaches zero. Undefined behavior ensues when the C++ side does the same..

enumerator copy

Create a new copy of the returned object, which will be owned by Python.

This policy is comparably safe because the lifetimes of the two instances are decoupled.

enumerator move

Use std::move to move the return value contents into a new instance that will be owned by Python.

This policy is comparably safe because the lifetimes of the two instances (move source and destination) are decoupled.

enumerator reference

Reference an existing object, but do not take ownership.

The C++ side is responsible for managing the object’s lifetime and deallocating it when it is no longer used. Warning: undefined behavior will ensue when the C++ side deletes an object that is still referenced and used by Python.

enumerator reference_internal

This policy only applies to methods and properties.

It references the object without taking ownership similar to the above return_value_policy::reference policy. In contrast to that policy, the function or property’s implicit this argument (called the parent) is considered to be the the owner of the return value (the child). pybind11 then couples the lifetime of the parent to the child via a reference relationship that ensures that the parent cannot be garbage collected while Python is still using the child. More advanced variations of this scheme are also possible using combinations of return_value_policy::reference and the keep_alive call policy

Functions

static inline constexpr int log2(size_t n, int k = 0)
static inline constexpr size_t size_in_ptrs(size_t s)
constexpr size_t instance_simple_holder_in_ptrs()

The space to allocate for simple layout instance holders (see below) in multiple of the size of a pointer (e.g.

2 means 16 bytes on 64-bit architectures). The default is the minimum required to holder either a std::unique_ptr or std::shared_ptr (which is almost always sizeof(std::shared_ptr<T>)).

constexpr size_t constexpr_sum()

Compile-time integer sum.

template<typename T, typename ...Ts>
constexpr size_t constexpr_sum(T n, Ts... ns)
constexpr int first(int i)

Implementation details for constexpr functions.

template<typename T, typename ...Ts>
constexpr int first(int i, T v, Ts... vs)
constexpr int last(int, int result)
template<typename T, typename ...Ts>
constexpr int last(int i, int result, T v, Ts... vs)
template<template<typename> class Predicate, typename ...Ts>
constexpr int constexpr_first()

Return the index of the first type in Ts which satisfies Predicate<T>.

Returns sizeof…(Ts) if none match.

template<template<typename> class Predicate, typename ...Ts>
constexpr int constexpr_last()

Return the index of the last type in Ts which satisfies Predicate<T>, or -1 if none match.

inline void ignore_unused(const int*)

Ignore that a variable is unused in compiler warnings.

PYBIND11_RUNTIME_EXCEPTION (cast_error, PyExc_RuntimeError) PYBIND11_RUNTIME_EXCEPTION(reference_cast_error

Thrown when pybind11::cast or handle::call fail due to a type casting error.

inline PyExc_RuntimeError [[noreturn]] PYBIND11_NOINLINE void pybind11_fail (const char *reason)

Used internally.

inline PYBIND11_NOINLINE void pybind11_fail (const std::string &reason)

Variables

static constexpr auto const_ = std::true_type{}

Const member function selector for overload_cast.

  • regular: static_cast<Return (Class::*)(Arg) const>(&Class::func)

  • sweet: overload_cast<Arg>(&Class::func, const_)

file common.h
#include “detail/common.h”
file common.h
#include <Python.h>#include <frameobject.h>#include <pythread.h>#include <cstddef>#include <cstring>#include <forward_list>#include <vector>#include <string>#include <stdexcept>#include <unordered_set>#include <unordered_map>#include <memory>#include <typeindex>#include <type_traits>

Defines

NAMESPACE_BEGIN(name)
NAMESPACE_END(name)
PYBIND11_NAMESPACE
PYBIND11_EXPORT
PYBIND11_NOINLINE
PYBIND11_DEPRECATED(reason)
PYBIND11_VERSION_MAJOR
PYBIND11_VERSION_MINOR
PYBIND11_VERSION_PATCH
PYBIND11_INSTANCE_METHOD_NEW(ptr, class_)

Include Python header, disable linking to pythonX_d.lib on Windows in debug mode.

Compatibility macros for various Python versions

PYBIND11_INSTANCE_METHOD_CHECK
PYBIND11_INSTANCE_METHOD_GET_FUNCTION
PYBIND11_BYTES_CHECK
PYBIND11_BYTES_FROM_STRING
PYBIND11_BYTES_FROM_STRING_AND_SIZE
PYBIND11_BYTES_AS_STRING_AND_SIZE
PYBIND11_BYTES_AS_STRING
PYBIND11_BYTES_SIZE
PYBIND11_LONG_CHECK(o)
PYBIND11_LONG_AS_LONGLONG(o)
PYBIND11_LONG_FROM_SIGNED(o)
PYBIND11_LONG_FROM_UNSIGNED(o)
PYBIND11_BYTES_NAME
PYBIND11_STRING_NAME
PYBIND11_SLICE_OBJECT
PYBIND11_FROM_STRING
PYBIND11_STR_TYPE
PYBIND11_BOOL_ATTR
PYBIND11_NB_BOOL(ptr)
PYBIND11_PLUGIN_IMPL(name)
PYBIND11_TRY_NEXT_OVERLOAD
PYBIND11_STRINGIFY(x)
PYBIND11_TOSTRING(x)
PYBIND11_CONCAT(first, second)
PYBIND11_ENSURE_INTERNALS_READY
PYBIND11_CHECK_PYTHON_VERSION
PYBIND11_CATCH_INIT_EXCEPTIONS
PYBIND11_PLUGIN(name)

Deprecated in favor of PYBIND11_MODULE***

This macro creates the entry point that will be invoked when the Python interpreter imports a plugin library. Please create a module in the function body and return the pointer to its underlying Python object at the end.

.. code-block:: cpp

PYBIND11_PLUGIN(example) {
    pybind11::module m("example", "pybind11 example plugin");
/ Set up bindings here return m.ptr(); }

PYBIND11_MODULE(name, variable)

This macro creates the entry point that will be invoked when the Python interpreter imports an extension module.

The module name is given as the fist argument and it should not be in quotes. The second macro argument defines a variable of type py::module which can be used to initialize the module.

.. code-block:: cpp

PYBIND11_MODULE(example, m) {
    m.doc() = "pybind11 example module";

Add bindings here m.def(“foo”, []() { return “Hello, World!”; }); }

PYBIND11_EXPAND_SIDE_EFFECTS(PATTERN)
PYBIND11_RUNTIME_EXCEPTION(name, type)

Typedefs

using ssize_t = Py_ssize_t
using size_t = std::size_t
using enable_if_t = typename std::enable_if<B, T>::type

from cpp_future import (convenient aliases from C++14/17)

using conditional_t = typename std::conditional<B, T, F>::type
using remove_cv_t = typename std::remove_cv<T>::type
using remove_reference_t = typename std::remove_reference<T>::type
using make_index_sequence = typename make_index_sequence_impl<N>::type
using select_indices = typename select_indices_impl<index_sequence<>, 0, Bs...>::type
using bool_constant = std::integral_constant<bool, B>

Backports of std::bool_constant and std::negation to accommodate older compilers.

using void_t = typename void_t_impl<Ts...>::type
using all_of = std::is_same<bools<Ts::value..., true>, bools<true, Ts::value...>>
using any_of = negation<all_of<negation<Ts>...>>
using none_of = negation<any_of<Ts...>>
using satisfies_all_of = all_of<Predicates<T>...>
using satisfies_any_of = any_of<Predicates<T>...>
using satisfies_none_of = none_of<Predicates<T>...>
using intrinsic_t = typename intrinsic_type<T>::type
using exactly_one_t = typename exactly_one<Predicate, Default, Ts...>::type
using deferred_t = typename deferred_type<T, Us...>::type
using is_strict_base_of = bool_constant<std::is_base_of<Base, Derived>::value && !std::is_same<Base, Derived>::value>

Like is_base_of, but requires a strict base (i.e.

is_strict_base_of<T, T>value == false, unlike std::is_base_of)

using is_accessible_base_of = bool_constant<std::is_base_of<Base, Derived>::value && std::is_convertible<Derived*, Base*>::value>

Like is_base_of, but also requires that the base type is accessible (i.e.

that a Derived pointer can be converted to a Base pointer)

using is_template_base_of = decltype(is_template_base_of_impl<Base>::check((intrinsic_t<T>*)nullptr))

Check if a template is the base of a type.

For example: is_template_base_of<Base, T> is true if struct T : Base<U> {} where U can be anything

using is_shared_ptr = is_instantiation<std::shared_ptr, T>

Check if T is std::shared_ptr<U> where U can be anything.

using is_function_pointer = bool_constant<std::is_pointer<T>::value && std::is_function<typename std::remove_pointer<T>::type>::value>
using function_signature_t = conditional_t<std::is_function<F>::value, F, typename conditional_t<std::is_pointer<F>::value || std::is_member_pointer<F>::value, std::remove_pointer<F>, strip_function_object<F>>::type>
using is_lambda = satisfies_none_of<remove_reference_t<T>, std::is_function, std::is_pointer, std::is_member_pointer>

Returns true if the type looks like a lambda: that is, isn’t a function, pointer or member pointer.

Note that this can catch all sorts of other things, too; this is intended to be used in a place where passing a lambda makes sense.

using expand_side_effects = bool[]

Apply a function over each element of a parameter pack.

Enums

enum return_value_policy

Approach used to cast a previously unknown C++ instance into a Python object.

Values:

enumerator automatic

This is the default return value policy, which falls back to the policy return_value_policy::take_ownership when the return value is a pointer.

Otherwise, it uses return_value::move or return_value::copy for rvalue and lvalue references, respectively. See below for a description of what all of these different policies do.

enumerator automatic_reference

As above, but use policy return_value_policy::reference when the return value is a pointer.

This is the default conversion policy for function arguments when calling Python functions manually from C++ code (i.e. via handle::operator()). You probably won’t need to use this.

enumerator take_ownership

Reference an existing object (i.e.

do not create a new copy) and take ownership. Python will call the destructor and delete operator when the object’s reference count reaches zero. Undefined behavior ensues when the C++ side does the same..

enumerator copy

Create a new copy of the returned object, which will be owned by Python.

This policy is comparably safe because the lifetimes of the two instances are decoupled.

enumerator move

Use std::move to move the return value contents into a new instance that will be owned by Python.

This policy is comparably safe because the lifetimes of the two instances (move source and destination) are decoupled.

enumerator reference

Reference an existing object, but do not take ownership.

The C++ side is responsible for managing the object’s lifetime and deallocating it when it is no longer used. Warning: undefined behavior will ensue when the C++ side deletes an object that is still referenced and used by Python.

enumerator reference_internal

This policy only applies to methods and properties.

It references the object without taking ownership similar to the above return_value_policy::reference policy. In contrast to that policy, the function or property’s implicit this argument (called the parent) is considered to be the the owner of the return value (the child). pybind11 then couples the lifetime of the parent to the child via a reference relationship that ensures that the parent cannot be garbage collected while Python is still using the child. More advanced variations of this scheme are also possible using combinations of return_value_policy::reference and the keep_alive call policy

enumerator automatic

This is the default return value policy, which falls back to the policy return_value_policy::take_ownership when the return value is a pointer.

Otherwise, it uses return_value::move or return_value::copy for rvalue and lvalue references, respectively. See below for a description of what all of these different policies do.

enumerator automatic_reference

As above, but use policy return_value_policy::reference when the return value is a pointer.

This is the default conversion policy for function arguments when calling Python functions manually from C++ code (i.e. via handle::operator()). You probably won’t need to use this.

enumerator take_ownership

Reference an existing object (i.e.

do not create a new copy) and take ownership. Python will call the destructor and delete operator when the object’s reference count reaches zero. Undefined behavior ensues when the C++ side does the same..

enumerator copy

Create a new copy of the returned object, which will be owned by Python.

This policy is comparably safe because the lifetimes of the two instances are decoupled.

enumerator move

Use std::move to move the return value contents into a new instance that will be owned by Python.

This policy is comparably safe because the lifetimes of the two instances (move source and destination) are decoupled.

enumerator reference

Reference an existing object, but do not take ownership.

The C++ side is responsible for managing the object’s lifetime and deallocating it when it is no longer used. Warning: undefined behavior will ensue when the C++ side deletes an object that is still referenced and used by Python.

enumerator reference_internal

This policy only applies to methods and properties.

It references the object without taking ownership similar to the above return_value_policy::reference policy. In contrast to that policy, the function or property’s implicit this argument (called the parent) is considered to be the the owner of the return value (the child). pybind11 then couples the lifetime of the parent to the child via a reference relationship that ensures that the parent cannot be garbage collected while Python is still using the child. More advanced variations of this scheme are also possible using combinations of return_value_policy::reference and the keep_alive call policy

Functions

static inline constexpr int log2(size_t n, int k = 0)
static inline constexpr size_t size_in_ptrs(size_t s)
constexpr size_t instance_simple_holder_in_ptrs()

The space to allocate for simple layout instance holders (see below) in multiple of the size of a pointer (e.g.

2 means 16 bytes on 64-bit architectures). The default is the minimum required to holder either a std::unique_ptr or std::shared_ptr (which is almost always sizeof(std::shared_ptr<T>)).

constexpr size_t constexpr_sum()

Compile-time integer sum.

template<typename T, typename ...Ts>
constexpr size_t constexpr_sum(T n, Ts... ns)
constexpr int first(int i)

Implementation details for constexpr functions.

template<typename T, typename ...Ts>
constexpr int first(int i, T v, Ts... vs)
constexpr int last(int, int result)
template<typename T, typename ...Ts>
constexpr int last(int i, int result, T v, Ts... vs)
template<template<typename> class Predicate, typename ...Ts>
constexpr int constexpr_first()

Return the index of the first type in Ts which satisfies Predicate<T>.

Returns sizeof…(Ts) if none match.

template<template<typename> class Predicate, typename ...Ts>
constexpr int constexpr_last()

Return the index of the last type in Ts which satisfies Predicate<T>, or -1 if none match.

inline void ignore_unused(const int*)

Ignore that a variable is unused in compiler warnings.

PYBIND11_RUNTIME_EXCEPTION (cast_error, PyExc_RuntimeError) PYBIND11_RUNTIME_EXCEPTION(reference_cast_error

Thrown when pybind11::cast or handle::call fail due to a type casting error.

inline PyExc_RuntimeError [[noreturn]] PYBIND11_NOINLINE void pybind11_fail (const char *reason)

Used internally.

inline PYBIND11_NOINLINE void pybind11_fail (const std::string &reason)

Variables

static constexpr auto const_ = std::true_type{}

Const member function selector for overload_cast.

  • regular: static_cast<Return (Class::*)(Arg) const>(&Class::func)

  • sweet: overload_cast<Arg>(&Class::func, const_)

file complex.h
#include “pybind11.h”#include <complex>
file complex.h
#include “pybind11.h”#include <complex>
file class.h
#include “../attr.h”#include “../options.h”

Defines

PYBIND11_SET_OLDPY_QUALNAME(obj, nameobj)

Functions

inline PyTypeObject *type_incref(PyTypeObject *type)
inline PyObject *pybind11_static_get(PyObject *self, PyObject*, PyObject *cls)

pybind11_static_property.__get__(): Always pass the class instead of the instance.

inline int pybind11_static_set(PyObject *self, PyObject *obj, PyObject *value)

pybind11_static_property.__set__(): Just like the above __get__().

inline PyTypeObject *make_static_property_type()

A static_property is the same as a property but the __get__() and __set__() methods are modified to always use the object type instead of a concrete instance.

Return value: New reference.

inline int pybind11_meta_setattro(PyObject *obj, PyObject *name, PyObject *value)

Types with static properties need to handle Type.static_prop = x in a specific way.

By default, Python replaces the static_property itself, but for wrapped C++ types we need to call static_property.__set__() in order to propagate the new value to the underlying C++ data structure.

inline PyTypeObject *make_default_metaclass()

This metaclass is assigned by default to all pybind11 types and is required in order for static properties to function correctly.

Users may override this using py::metaclass. Return value: New reference.

inline void traverse_offset_bases(void *valueptr, const detail::type_info *tinfo, instance *self, bool (*f)(void*, instance*))

For multiple inheritance types we need to recursively register/deregister base pointers for any base classes with pointers that are difference from the instance value pointer so that we can correctly recognize an offset base class pointer.

This calls a function with any offset base ptrs.

inline bool register_instance_impl(void *ptr, instance *self)
inline bool deregister_instance_impl(void *ptr, instance *self)
inline void register_instance(instance *self, void *valptr, const type_info *tinfo)
inline bool deregister_instance(instance *self, void *valptr, const type_info *tinfo)
inline PyObject *make_new_instance(PyTypeObject *type)

Instance creation function for all pybind11 types.

It allocates the internal instance layout for holding C++ objects and holders. Allocation is done lazily (the first time the instance is cast to a reference or pointer), and initialization is done by an __init__ function.

inline PyObject *pybind11_object_new(PyTypeObject *type, PyObject*, PyObject*)

Instance creation function for all pybind11 types.

It only allocates space for the C++ object, but doesn’t call the constructor an __init__ function must do that.

inline int pybind11_object_init(PyObject *self, PyObject*, PyObject*)

An __init__ function constructs the C++ object.

Users should provide at least one of these using py::init or directly with .def(__init__, ...). Otherwise, the following default function will be used which simply throws an exception.

inline void add_patient(PyObject *nurse, PyObject *patient)
inline void clear_patients(PyObject *self)
inline void clear_instance(PyObject *self)

Clears all internal data from the instance and removes it from registered instances in preparation for deallocation.

inline void pybind11_object_dealloc(PyObject *self)

Instance destructor function for all pybind11 types.

It calls type_info.dealloc to destroy the C++ object itself, while the rest is Python bookkeeping.

inline PyObject *make_object_base_type(PyTypeObject *metaclass)

Create the type which can be used as a common base for all classes.

This is needed in order to satisfy Python’s requirements for multiple inheritance. Return value: New reference.

inline PyObject *pybind11_get_dict(PyObject *self, void*)

dynamic_attr: Support for d = instance.__dict__.

inline int pybind11_set_dict(PyObject *self, PyObject *new_dict, void*)

dynamic_attr: Support for instance.__dict__ = dict().

inline int pybind11_traverse(PyObject *self, visitproc visit, void *arg)

dynamic_attr: Allow the garbage collector to traverse the internal instance __dict__.

inline int pybind11_clear(PyObject *self)

dynamic_attr: Allow the GC to clear the dictionary.

inline void enable_dynamic_attributes(PyHeapTypeObject *heap_type)

Give instances of this type a __dict__ and opt into garbage collection.

inline int pybind11_getbuffer(PyObject *obj, Py_buffer *view, int flags)

buffer_protocol: Fill in the view as specified by flags.

inline void pybind11_releasebuffer(PyObject*, Py_buffer *view)

buffer_protocol: Release the resources of the buffer.

inline void enable_buffer_protocol(PyHeapTypeObject *heap_type)

Give this type a buffer interface.

inline PyObject *make_new_python_type(const type_record &rec)

Create a brand new Python type according to the type_record specification.

Return value: New reference.

file class.h
#include “../attr.h”#include “../options.h”

Defines

PYBIND11_SET_OLDPY_QUALNAME(obj, nameobj)

Functions

inline PyTypeObject *type_incref(PyTypeObject *type)
inline PyObject *pybind11_static_get(PyObject *self, PyObject*, PyObject *cls)

pybind11_static_property.__get__(): Always pass the class instead of the instance.

inline int pybind11_static_set(PyObject *self, PyObject *obj, PyObject *value)

pybind11_static_property.__set__(): Just like the above __get__().

inline PyTypeObject *make_static_property_type()

A static_property is the same as a property but the __get__() and __set__() methods are modified to always use the object type instead of a concrete instance.

Return value: New reference.

inline int pybind11_meta_setattro(PyObject *obj, PyObject *name, PyObject *value)

Types with static properties need to handle Type.static_prop = x in a specific way.

By default, Python replaces the static_property itself, but for wrapped C++ types we need to call static_property.__set__() in order to propagate the new value to the underlying C++ data structure.

inline PyTypeObject *make_default_metaclass()

This metaclass is assigned by default to all pybind11 types and is required in order for static properties to function correctly.

Users may override this using py::metaclass. Return value: New reference.

inline void traverse_offset_bases(void *valueptr, const detail::type_info *tinfo, instance *self, bool (*f)(void*, instance*))

For multiple inheritance types we need to recursively register/deregister base pointers for any base classes with pointers that are difference from the instance value pointer so that we can correctly recognize an offset base class pointer.

This calls a function with any offset base ptrs.

inline bool register_instance_impl(void *ptr, instance *self)
inline bool deregister_instance_impl(void *ptr, instance *self)
inline void register_instance(instance *self, void *valptr, const type_info *tinfo)
inline bool deregister_instance(instance *self, void *valptr, const type_info *tinfo)
inline PyObject *make_new_instance(PyTypeObject *type)

Instance creation function for all pybind11 types.

It allocates the internal instance layout for holding C++ objects and holders. Allocation is done lazily (the first time the instance is cast to a reference or pointer), and initialization is done by an __init__ function.

inline PyObject *pybind11_object_new(PyTypeObject *type, PyObject*, PyObject*)

Instance creation function for all pybind11 types.

It only allocates space for the C++ object, but doesn’t call the constructor an __init__ function must do that.

inline int pybind11_object_init(PyObject *self, PyObject*, PyObject*)

An __init__ function constructs the C++ object.

Users should provide at least one of these using py::init or directly with .def(__init__, ...). Otherwise, the following default function will be used which simply throws an exception.

inline void add_patient(PyObject *nurse, PyObject *patient)
inline void clear_patients(PyObject *self)
inline void clear_instance(PyObject *self)

Clears all internal data from the instance and removes it from registered instances in preparation for deallocation.

inline void pybind11_object_dealloc(PyObject *self)

Instance destructor function for all pybind11 types.

It calls type_info.dealloc to destroy the C++ object itself, while the rest is Python bookkeeping.

inline PyObject *make_object_base_type(PyTypeObject *metaclass)

Create the type which can be used as a common base for all classes.

This is needed in order to satisfy Python’s requirements for multiple inheritance. Return value: New reference.

inline PyObject *pybind11_get_dict(PyObject *self, void*)

dynamic_attr: Support for d = instance.__dict__.

inline int pybind11_set_dict(PyObject *self, PyObject *new_dict, void*)

dynamic_attr: Support for instance.__dict__ = dict().

inline int pybind11_traverse(PyObject *self, visitproc visit, void *arg)

dynamic_attr: Allow the garbage collector to traverse the internal instance __dict__.

inline int pybind11_clear(PyObject *self)

dynamic_attr: Allow the GC to clear the dictionary.

inline void enable_dynamic_attributes(PyHeapTypeObject *heap_type)

Give instances of this type a __dict__ and opt into garbage collection.

inline int pybind11_getbuffer(PyObject *obj, Py_buffer *view, int flags)

buffer_protocol: Fill in the view as specified by flags.

inline void pybind11_releasebuffer(PyObject*, Py_buffer *view)

buffer_protocol: Release the resources of the buffer.

inline void enable_buffer_protocol(PyHeapTypeObject *heap_type)

Give this type a buffer interface.

inline PyObject *make_new_python_type(const type_record &rec)

Create a brand new Python type according to the type_record specification.

Return value: New reference.

file descr.h
#include “common.h”

Defines

PYBIND11_DESCR_CONSTEXPR

Functions

template<size_t N1, size_t N2, typename ...Ts1, typename ...Ts2, size_t... Is1, size_t... Is2>
constexpr descr<N1 + N2, Ts1..., Ts2...> plus_impl(const descr<N1, Ts1...> &a, const descr<N2, Ts2...> &b, index_sequence<Is1...>, index_sequence<Is2...>)
template<size_t N1, size_t N2, typename ...Ts1, typename ...Ts2>
constexpr descr<N1 + N2, Ts1..., Ts2...> operator+(const descr<N1, Ts1...> &a, const descr<N2, Ts2...> &b)
template<size_t N>
constexpr descr<N - 1> _(char const (&text)[N])
constexpr descr<0> _(char const (&)[1])
template<bool B, size_t N1, size_t N2>
constexpr enable_if_t<B, descr<N1 - 1>> _(char const (&text1)[N1], char const (&)[N2])
template<bool B, size_t N1, size_t N2>
constexpr enable_if_t<!B, descr<N2 - 1>> _(char const (&)[N1], char const (&text2)[N2])
template<bool B, typename T1, typename T2>
constexpr enable_if_t<B, T1> _(const T1 &d, const T2&)
template<bool B, typename T1, typename T2>
constexpr enable_if_t<!B, T2> _(const T1&, const T2 &d)
template<size_t Size>
auto constexpr _() -> decltype(int_to_str<Size / 10, Size % 10>::digits)
template<typename Type>
constexpr descr<1, Type> _()
constexpr descr<0> concat()
template<size_t N, typename ...Ts>
constexpr descr<N, Ts...> concat(const descr<N, Ts...> &descr)
template<size_t N, typename ...Ts, typename ...Args>
constexpr auto concat(const descr<N, Ts...> &d, const Args&... args) -> decltype(std::declval<descr<N + 2, Ts...>>() + concat(args...))
template<size_t N, typename ...Ts>
constexpr descr<N + 2, Ts...> type_descr(const descr<N, Ts...> &descr)
file descr.h
#include “common.h”

Defines

PYBIND11_DESCR_CONSTEXPR

Functions

template<size_t N1, size_t N2, typename ...Ts1, typename ...Ts2, size_t... Is1, size_t... Is2>
constexpr descr<N1 + N2, Ts1..., Ts2...> plus_impl(const descr<N1, Ts1...> &a, const descr<N2, Ts2...> &b, index_sequence<Is1...>, index_sequence<Is2...>)
template<size_t N1, size_t N2, typename ...Ts1, typename ...Ts2>
constexpr descr<N1 + N2, Ts1..., Ts2...> operator+(const descr<N1, Ts1...> &a, const descr<N2, Ts2...> &b)
template<size_t N>
constexpr descr<N - 1> _(char const (&text)[N])
constexpr descr<0> _(char const (&)[1])
template<bool B, size_t N1, size_t N2>
constexpr enable_if_t<B, descr<N1 - 1>> _(char const (&text1)[N1], char const (&)[N2])
template<bool B, size_t N1, size_t N2>
constexpr enable_if_t<!B, descr<N2 - 1>> _(char const (&)[N1], char const (&text2)[N2])
template<bool B, typename T1, typename T2>
constexpr enable_if_t<B, T1> _(const T1 &d, const T2&)
template<bool B, typename T1, typename T2>
constexpr enable_if_t<!B, T2> _(const T1&, const T2 &d)
template<size_t Size>
auto constexpr _() -> decltype(int_to_str<Size / 10, Size % 10>::digits)
template<typename Type>
constexpr descr<1, Type> _()
constexpr descr<0> concat()
template<size_t N, typename ...Ts>
constexpr descr<N, Ts...> concat(const descr<N, Ts...> &descr)
template<size_t N, typename ...Ts, typename ...Args>
constexpr auto concat(const descr<N, Ts...> &d, const Args&... args) -> decltype(std::declval<descr<N + 2, Ts...>>() + concat(args...))
template<size_t N, typename ...Ts>
constexpr descr<N + 2, Ts...> type_descr(const descr<N, Ts...> &descr)
file init.h
#include “class.h”

Typedefs

using Cpp = typename Class::type
using Alias = typename Class::type_alias
using Holder = typename Class::holder_type
using is_alias_constructible = std::is_constructible<Alias<Class>, Cpp<Class>&&>

Functions

inline void no_nullptr(void *ptr)
template<typename Class, enable_if_t<Class::has_alias, int> = 0>
bool is_alias(Cpp<Class> *ptr)
template<typename>
constexpr bool is_alias(void*)
template<typename Class, typename ...Args, detail::enable_if_t<std::is_constructible<Class, Args...>::value, int> = 0>
inline Class *construct_or_initialize(Args&&... args)
template<typename Class>
void construct_alias_from_cpp(std::true_type, value_and_holder &v_h, Cpp<Class> &&base)
template<typename Class>
void construct_alias_from_cpp(std::false_type, value_and_holder&, Cpp<Class>&&)
template<typename Class>
void construct(...)
template<typename Class>
void construct(value_and_holder &v_h, Cpp<Class> *ptr, bool need_alias)
template<typename Class, enable_if_t<Class::has_alias, int> = 0>
void construct(value_and_holder &v_h, Alias<Class> *alias_ptr, bool)
template<typename Class>
void construct(value_and_holder &v_h, Holder<Class> holder, bool need_alias)
template<typename Class>
void construct(value_and_holder &v_h, Cpp<Class> &&result, bool need_alias)
template<typename Class>
void construct(value_and_holder &v_h, Alias<Class> &&result, bool)
template<typename Class, typename T>
void setstate(value_and_holder &v_h, T &&result, bool need_alias)

Set just the C++ state. Same as __init__.

template<typename Class, typename T, typename O, enable_if_t<std::is_convertible<O, handle>::value, int> = 0>
void setstate(value_and_holder &v_h, std::pair<T, O> &&result, bool need_alias)

Set both the C++ and Python states.

file init.h
#include “class.h”

Typedefs

using Cpp = typename Class::type
using Alias = typename Class::type_alias
using Holder = typename Class::holder_type
using is_alias_constructible = std::is_constructible<Alias<Class>, Cpp<Class>&&>

Functions

inline void no_nullptr(void *ptr)
template<typename Class, enable_if_t<Class::has_alias, int> = 0>
bool is_alias(Cpp<Class> *ptr)
template<typename>
constexpr bool is_alias(void*)
template<typename Class, typename ...Args, detail::enable_if_t<std::is_constructible<Class, Args...>::value, int> = 0>
inline Class *construct_or_initialize(Args&&... args)
template<typename Class>
void construct_alias_from_cpp(std::true_type, value_and_holder &v_h, Cpp<Class> &&base)
template<typename Class>
void construct_alias_from_cpp(std::false_type, value_and_holder&, Cpp<Class>&&)
template<typename Class>
void construct(...)
template<typename Class>
void construct(value_and_holder &v_h, Cpp<Class> *ptr, bool need_alias)
template<typename Class, enable_if_t<Class::has_alias, int> = 0>
void construct(value_and_holder &v_h, Alias<Class> *alias_ptr, bool)
template<typename Class>
void construct(value_and_holder &v_h, Holder<Class> holder, bool need_alias)
template<typename Class>
void construct(value_and_holder &v_h, Cpp<Class> &&result, bool need_alias)
template<typename Class>
void construct(value_and_holder &v_h, Alias<Class> &&result, bool)
template<typename Class, typename T>
void setstate(value_and_holder &v_h, T &&result, bool need_alias)

Set just the C++ state. Same as __init__.

template<typename Class, typename T, typename O, enable_if_t<std::is_convertible<O, handle>::value, int> = 0>
void setstate(value_and_holder &v_h, std::pair<T, O> &&result, bool need_alias)

Set both the C++ and Python states.

file internals.h
#include “../pytypes.h”

Defines

PYBIND11_TLS_KEY_INIT(var)
PYBIND11_TLS_GET_VALUE(key)
PYBIND11_TLS_DELETE_VALUE(key)
PYBIND11_TLS_REPLACE_VALUE(key, value)
PYBIND11_TLS_FREE(key)
PYBIND11_INTERNALS_VERSION

Tracks the internals and type_info ABI version independent of the main library version.

PYBIND11_BUILD_TYPE

On MSVC, debug and release builds are not ABI-compatible!

PYBIND11_COMPILER_TYPE

Let’s assume that different compilers are ABI-incompatible.

PYBIND11_STDLIB
PYBIND11_BUILD_ABI

On Linux/OSX, changes in GXX_ABI_VERSION indicate ABI incompatibility.

PYBIND11_INTERNALS_KIND
PYBIND11_INTERNALS_ID
PYBIND11_MODULE_LOCAL_ID

Typedefs

using type_map = std::unordered_map<std::type_index, value_type, type_hash, type_equal_to>

Functions

inline PyTypeObject *make_static_property_type()

A static_property is the same as a property but the __get__() and __set__() methods are modified to always use the object type instead of a concrete instance.

Return value: New reference.

inline PyTypeObject *make_default_metaclass()

This metaclass is assigned by default to all pybind11 types and is required in order for static properties to function correctly.

Users may override this using py::metaclass. Return value: New reference.

inline PyObject *make_object_base_type(PyTypeObject *metaclass)

Create the type which can be used as a common base for all classes.

This is needed in order to satisfy Python’s requirements for multiple inheritance. Return value: New reference.

inline bool same_type(const std::type_info &lhs, const std::type_info &rhs)
inline internals **&get_internals_pp()

Each module locally stores a pointer to the internals data.

The data itself is shared among modules with the same PYBIND11_INTERNALS_ID.

inline void translate_exception(std::exception_ptr p)
inline void translate_local_exception(std::exception_ptr p)
inline PYBIND11_NOINLINE internals & get_internals ()

Return a reference to the current internals data.

inline type_map<type_info*> &registered_local_types_cpp()

Works like internals.registered_types_cpp, but for module-local registered types:

template<typename ...Args>
const char *c_str(Args&&... args)

Constructs a std::string with the given arguments, stores it in internals, and returns its c_str().

Such strings objects have a long storage duration the internal strings are only cleared when the program exits or after interpreter shutdown (when embedding), and so are suitable for c-style strings needed by Python internals (such as PyTypeObject’s tp_name).

inline PYBIND11_NOINLINE void * get_shared_data (const std::string &name)

Returns a named pointer that is shared among all extension modules (using the same pybind11 version) running in the current interpreter.

Names starting with underscores are reserved for internal usage. Returns nullptr if no matching entry was found.

inline PYBIND11_NOINLINE void * set_shared_data (const std::string &name, void *data)

Set the shared data that can be later recovered by get_shared_data().

template<typename T>
T &get_or_create_shared_data(const std::string &name)

Returns a typed reference to a shared data entry (by using get_shared_data()) if such entry exists.

Otherwise, a new object of default-constructible type T is added to the shared data under the given name and a reference to it is returned.

file internals.h
#include “../pytypes.h”

Defines

PYBIND11_TLS_KEY_INIT(var)
PYBIND11_TLS_GET_VALUE(key)
PYBIND11_TLS_DELETE_VALUE(key)
PYBIND11_TLS_REPLACE_VALUE(key, value)
PYBIND11_TLS_FREE(key)
PYBIND11_INTERNALS_VERSION

Tracks the internals and type_info ABI version independent of the main library version.

PYBIND11_BUILD_TYPE

On MSVC, debug and release builds are not ABI-compatible!

PYBIND11_COMPILER_TYPE

Let’s assume that different compilers are ABI-incompatible.

PYBIND11_STDLIB
PYBIND11_BUILD_ABI

On Linux/OSX, changes in GXX_ABI_VERSION indicate ABI incompatibility.

PYBIND11_INTERNALS_KIND
PYBIND11_INTERNALS_ID
PYBIND11_MODULE_LOCAL_ID

Typedefs

using type_map = std::unordered_map<std::type_index, value_type, type_hash, type_equal_to>

Functions

inline PyTypeObject *make_static_property_type()

A static_property is the same as a property but the __get__() and __set__() methods are modified to always use the object type instead of a concrete instance.

Return value: New reference.

inline PyTypeObject *make_default_metaclass()

This metaclass is assigned by default to all pybind11 types and is required in order for static properties to function correctly.

Users may override this using py::metaclass. Return value: New reference.

inline PyObject *make_object_base_type(PyTypeObject *metaclass)

Create the type which can be used as a common base for all classes.

This is needed in order to satisfy Python’s requirements for multiple inheritance. Return value: New reference.

inline bool same_type(const std::type_info &lhs, const std::type_info &rhs)
inline internals **&get_internals_pp()

Each module locally stores a pointer to the internals data.

The data itself is shared among modules with the same PYBIND11_INTERNALS_ID.

inline void translate_exception(std::exception_ptr p)
inline void translate_local_exception(std::exception_ptr p)
inline PYBIND11_NOINLINE internals & get_internals ()

Return a reference to the current internals data.

inline type_map<type_info*> &registered_local_types_cpp()

Works like internals.registered_types_cpp, but for module-local registered types:

template<typename ...Args>
const char *c_str(Args&&... args)

Constructs a std::string with the given arguments, stores it in internals, and returns its c_str().

Such strings objects have a long storage duration the internal strings are only cleared when the program exits or after interpreter shutdown (when embedding), and so are suitable for c-style strings needed by Python internals (such as PyTypeObject’s tp_name).

inline PYBIND11_NOINLINE void * get_shared_data (const std::string &name)

Returns a named pointer that is shared among all extension modules (using the same pybind11 version) running in the current interpreter.

Names starting with underscores are reserved for internal usage. Returns nullptr if no matching entry was found.

inline PYBIND11_NOINLINE void * set_shared_data (const std::string &name, void *data)

Set the shared data that can be later recovered by get_shared_data().

template<typename T>
T &get_or_create_shared_data(const std::string &name)

Returns a typed reference to a shared data entry (by using get_shared_data()) if such entry exists.

Otherwise, a new object of default-constructible type T is added to the shared data under the given name and a reference to it is returned.

file typeid.h
#include <cstdio>#include <cstdlib>#include “common.h”

Functions

inline void erase_all(std::string &string, const std::string &search)

Erase all occurrences of a substring.

inline PYBIND11_NOINLINE void clean_type_id (std::string &name)
template<typename T>
static std::string type_id()

Return a string representation of a C++ type.

file typeid.h
#include <cstdio>#include <cstdlib>#include “common.h”

Functions

inline void erase_all(std::string &string, const std::string &search)

Erase all occurrences of a substring.

inline PYBIND11_NOINLINE void clean_type_id (std::string &name)
template<typename T>
static std::string type_id()

Return a string representation of a C++ type.

file eigen.h
#include “numpy.h”#include <Eigen/Core>#include <Eigen/SparseCore>

Typedefs

using EigenDStride = Eigen::Stride<Eigen::Dynamic, Eigen::Dynamic>
using EigenDRef = Eigen::Ref<MatrixType, 0, EigenDStride>
using EigenDMap = Eigen::Map<MatrixType, 0, EigenDStride>
using EigenIndex = EIGEN_DEFAULT_DENSE_INDEX_TYPE
using is_eigen_dense_map = all_of<is_template_base_of<Eigen::DenseBase, T>, std::is_base_of<Eigen::MapBase<T, Eigen::ReadOnlyAccessors>, T>>
using is_eigen_mutable_map = std::is_base_of<Eigen::MapBase<T, Eigen::WriteAccessors>, T>
using is_eigen_dense_plain = all_of<negation<is_eigen_dense_map<T>>, is_template_base_of<Eigen::PlainObjectBase, T>>
using is_eigen_sparse = is_template_base_of<Eigen::SparseMatrixBase, T>
using is_eigen_other = all_of<is_template_base_of<Eigen::EigenBase, T>, negation<any_of<is_eigen_dense_map<T>, is_eigen_dense_plain<T>, is_eigen_sparse<T>>>>

Functions

template<typename props>
handle eigen_array_cast(typename props::Type const &src, handle base = handle(), bool writeable = true)
template<typename props, typename Type>
handle eigen_ref_array(Type &src, handle parent = none())
template<typename props, typename Type, typename = enable_if_t<is_eigen_dense_plain<Type>::value>>
handle eigen_encapsulate(Type *src)
file eigen.h
#include “numpy.h”#include <Eigen/Core>#include <Eigen/SparseCore>

Typedefs

using EigenDStride = Eigen::Stride<Eigen::Dynamic, Eigen::Dynamic>
using EigenDRef = Eigen::Ref<MatrixType, 0, EigenDStride>
using EigenDMap = Eigen::Map<MatrixType, 0, EigenDStride>
using EigenIndex = EIGEN_DEFAULT_DENSE_INDEX_TYPE
using is_eigen_dense_map = all_of<is_template_base_of<Eigen::DenseBase, T>, std::is_base_of<Eigen::MapBase<T, Eigen::ReadOnlyAccessors>, T>>
using is_eigen_mutable_map = std::is_base_of<Eigen::MapBase<T, Eigen::WriteAccessors>, T>
using is_eigen_dense_plain = all_of<negation<is_eigen_dense_map<T>>, is_template_base_of<Eigen::PlainObjectBase, T>>
using is_eigen_sparse = is_template_base_of<Eigen::SparseMatrixBase, T>
using is_eigen_other = all_of<is_template_base_of<Eigen::EigenBase, T>, negation<any_of<is_eigen_dense_map<T>, is_eigen_dense_plain<T>, is_eigen_sparse<T>>>>

Functions

template<typename props>
handle eigen_array_cast(typename props::Type const &src, handle base = handle(), bool writeable = true)
template<typename props, typename Type>
handle eigen_ref_array(Type &src, handle parent = none())
template<typename props, typename Type, typename = enable_if_t<is_eigen_dense_plain<Type>::value>>
handle eigen_encapsulate(Type *src)
file embed.h
#include “pybind11.h”#include “eval.h”

Defines

PYBIND11_EMBEDDED_MODULE_IMPL(name)
PYBIND11_EMBEDDED_MODULE(name, variable)

Add a new module to the table of builtins for the interpreter.

Must be defined in global scope. The first macro parameter is the name of the module (without quotes). The second parameter is the variable which will be used as the interface to add functions and classes to the module.

.. code-block:: cpp

PYBIND11_EMBEDDED_MODULE(example, m) {
… initialize functions and classes here m.def(“foo”, []() { return “Hello, World!”; }); }

Functions

inline void initialize_interpreter(bool init_signal_handlers = true)

Initialize the Python interpreter.

No other pybind11 or CPython API functions can be called before this is done; with the exception of PYBIND11_EMBEDDED_MODULE. The optional parameter can be used to skip the registration of signal handlers (see the Python documentation_ for details). Calling this function again after the interpreter has already been initialized is a fatal error.

If initializing the Python interpreter fails, then the program is terminated. (This is controlled by the CPython runtime and is an exception to pybind11’s normal behavior of throwing exceptions on errors.)

.. _Python documentation: https://docs.python.org/3/c-api/init.html#c.Py_InitializeEx

inline void finalize_interpreter()

Shut down the Python interpreter.

No pybind11 or CPython API functions can be called after this. In addition, pybind11 objects must not outlive the interpreter:

.. code-block:: cpp

{ // BAD
    py::initialize_interpreter();
    auto hello = py::str("Hello, World!");
    py::finalize_interpreter();
} // <-- BOOM, hello's destructor is called after interpreter shutdown

{ // GOOD
    py::initialize_interpreter();
    { // scoped
        auto hello = py::str("Hello, World!");
    } // <-- OK, hello is cleaned up properly
    py::finalize_interpreter();
}

{ // BETTER
    py::scoped_interpreter guard{};
    auto hello = py::str("Hello, World!");
}

.. warning::

The interpreter can be restarted by calling `initialize_interpreter` again.
Modules created using pybind11 can be safely re-initialized. However, Python
itself cannot completely unload binary extension modules and there are several
caveats with regard to interpreter restarting. All the details can be found
in the CPython documentation. In short, not all interpreter memory may be
freed, either due to reference cycles or user-created global data.

file embed.h
#include “pybind11.h”#include “eval.h”

Defines

PYBIND11_EMBEDDED_MODULE_IMPL(name)
PYBIND11_EMBEDDED_MODULE(name, variable)

Add a new module to the table of builtins for the interpreter.

Must be defined in global scope. The first macro parameter is the name of the module (without quotes). The second parameter is the variable which will be used as the interface to add functions and classes to the module.

.. code-block:: cpp

PYBIND11_EMBEDDED_MODULE(example, m) {
… initialize functions and classes here m.def(“foo”, []() { return “Hello, World!”; }); }

Functions

inline void initialize_interpreter(bool init_signal_handlers = true)

Initialize the Python interpreter.

No other pybind11 or CPython API functions can be called before this is done; with the exception of PYBIND11_EMBEDDED_MODULE. The optional parameter can be used to skip the registration of signal handlers (see the Python documentation_ for details). Calling this function again after the interpreter has already been initialized is a fatal error.

If initializing the Python interpreter fails, then the program is terminated. (This is controlled by the CPython runtime and is an exception to pybind11’s normal behavior of throwing exceptions on errors.)

.. _Python documentation: https://docs.python.org/3/c-api/init.html#c.Py_InitializeEx

inline void finalize_interpreter()

Shut down the Python interpreter.

No pybind11 or CPython API functions can be called after this. In addition, pybind11 objects must not outlive the interpreter:

.. code-block:: cpp

{ // BAD
    py::initialize_interpreter();
    auto hello = py::str("Hello, World!");
    py::finalize_interpreter();
} // <-- BOOM, hello's destructor is called after interpreter shutdown

{ // GOOD
    py::initialize_interpreter();
    { // scoped
        auto hello = py::str("Hello, World!");
    } // <-- OK, hello is cleaned up properly
    py::finalize_interpreter();
}

{ // BETTER
    py::scoped_interpreter guard{};
    auto hello = py::str("Hello, World!");
}

.. warning::

The interpreter can be restarted by calling `initialize_interpreter` again.
Modules created using pybind11 can be safely re-initialized. However, Python
itself cannot completely unload binary extension modules and there are several
caveats with regard to interpreter restarting. All the details can be found
in the CPython documentation. In short, not all interpreter memory may be
freed, either due to reference cycles or user-created global data.

file eval.h
#include “pybind11.h”

Enums

enum eval_mode

Values:

enumerator eval_expr

Evaluate a string containing an isolated expression.

enumerator eval_single_statement

Evaluate a string containing a single statement. Returns none.

enumerator eval_statements

Evaluate a string containing a sequence of statement. Returns none.

enumerator eval_expr

Evaluate a string containing an isolated expression.

enumerator eval_single_statement

Evaluate a string containing a single statement. Returns none.

enumerator eval_statements

Evaluate a string containing a sequence of statement. Returns none.

Functions

template<eval_mode mode = eval_expr>
object eval(str expr, object global = globals(), object local = object())
template<eval_mode mode = eval_expr, size_t N>
object eval(const char (&s)[N], object global = globals(), object local = object())
inline void exec(str expr, object global = globals(), object local = object())
template<size_t N>
void exec(const char (&s)[N], object global = globals(), object local = object())
template<eval_mode mode = eval_statements>
object eval_file(str fname, object global = globals(), object local = object())
file eval.h
#include “pybind11.h”

Enums

enum eval_mode

Values:

enumerator eval_expr

Evaluate a string containing an isolated expression.

enumerator eval_single_statement

Evaluate a string containing a single statement. Returns none.

enumerator eval_statements

Evaluate a string containing a sequence of statement. Returns none.

enumerator eval_expr

Evaluate a string containing an isolated expression.

enumerator eval_single_statement

Evaluate a string containing a single statement. Returns none.

enumerator eval_statements

Evaluate a string containing a sequence of statement. Returns none.

Functions

template<eval_mode mode = eval_expr>
object eval(str expr, object global = globals(), object local = object())
template<eval_mode mode = eval_expr, size_t N>
object eval(const char (&s)[N], object global = globals(), object local = object())
inline void exec(str expr, object global = globals(), object local = object())
template<size_t N>
void exec(const char (&s)[N], object global = globals(), object local = object())
template<eval_mode mode = eval_statements>
object eval_file(str fname, object global = globals(), object local = object())
file functional.h
#include “pybind11.h”#include <functional>
file functional.h
#include “pybind11.h”#include <functional>
file iostream.h
#include “pybind11.h”#include <streambuf>#include <ostream>#include <string>#include <memory>#include <iostream>

Functions

inline class_<detail::OstreamRedirect> add_ostream_redirect(module m, std::string name = "ostream_redirect")

This is a helper function to add a C++ redirect context manager to Python instead of using a C++ guard.

To use it, add the following to your binding code:

.. code-block:: cpp

#include <pybind11/iostream.h>

...

py::add_ostream_redirect(m, "ostream_redirect");

You now have a Python context manager that redirects your output:

.. code-block:: python

with m.ostream_redirect():
    m.print_to_cout_function()

This manager can optionally be told which streams to operate on:

.. code-block:: python

with m.ostream_redirect(stdout=true, stderr=true):
    m.noisy_function_with_error_printing()

file iostream.h
#include “pybind11.h”#include <streambuf>#include <ostream>#include <string>#include <memory>#include <iostream>

Functions

inline class_<detail::OstreamRedirect> add_ostream_redirect(module m, std::string name = "ostream_redirect")

This is a helper function to add a C++ redirect context manager to Python instead of using a C++ guard.

To use it, add the following to your binding code:

.. code-block:: cpp

#include <pybind11/iostream.h>

...

py::add_ostream_redirect(m, "ostream_redirect");

You now have a Python context manager that redirects your output:

.. code-block:: python

with m.ostream_redirect():
    m.print_to_cout_function()

This manager can optionally be told which streams to operate on:

.. code-block:: python

with m.ostream_redirect(stdout=true, stderr=true):
    m.noisy_function_with_error_printing()

file numpy.h
#include “pybind11.h”#include “complex.h”#include <numeric>#include <algorithm>#include <array>#include <cstdint>#include <cstdlib>#include <cstring>#include <sstream>#include <string>#include <functional>#include <utility>#include <vector>#include <typeindex>

Defines

DECL_NPY_API(Func)
PYBIND11_DECL_CHAR_FMT
PYBIND11_FIELD_DESCRIPTOR_EX(T, Field, Name)
PYBIND11_FIELD_DESCRIPTOR(T, Field)
PYBIND11_EVAL0(...)
PYBIND11_EVAL1(...)
PYBIND11_EVAL2(...)
PYBIND11_EVAL3(...)
PYBIND11_EVAL4(...)
PYBIND11_EVAL(...)
PYBIND11_MAP_END(...)
PYBIND11_MAP_OUT
PYBIND11_MAP_COMMA
PYBIND11_MAP_GET_END()
PYBIND11_MAP_NEXT0(test, next, ...)
PYBIND11_MAP_NEXT1(test, next)
PYBIND11_MAP_NEXT(test, next)
PYBIND11_MAP_LIST_NEXT1(test, next)
PYBIND11_MAP_LIST_NEXT(test, next)
PYBIND11_MAP_LIST0(f, t, x, peek, ...)
PYBIND11_MAP_LIST1(f, t, x, peek, ...)
PYBIND11_MAP_LIST(f, t, ...)
PYBIND11_NUMPY_DTYPE(Type, ...)
PYBIND11_MAP2_LIST_NEXT1(test, next)
PYBIND11_MAP2_LIST_NEXT(test, next)
PYBIND11_MAP2_LIST0(f, t, x1, x2, peek, ...)
PYBIND11_MAP2_LIST1(f, t, x1, x2, peek, ...)
PYBIND11_MAP2_LIST(f, t, ...)
PYBIND11_NUMPY_DTYPE_EX(Type, ...)

Typedefs

using remove_all_extents_t = typename array_info<T>::type
using is_pod_struct = all_of<std::is_standard_layout<T>, std::is_trivially_copyable<T>, satisfies_none_of<T, std::is_reference, std::is_array, is_std_array, std::is_arithmetic, is_complex, std::is_enum>>
using array_iterator = typename std::add_pointer<T>::type

Enums

enum broadcast_trivial

Values:

enumerator non_trivial
enumerator c_trivial
enumerator f_trivial
enumerator non_trivial
enumerator c_trivial
enumerator f_trivial

Functions

inline PYBIND11_NOINLINE void load_numpy_internals (numpy_internals *&ptr)
inline numpy_internals &get_numpy_internals()
template<typename Concrete>
constexpr int platform_lookup()
template<typename Concrete, typename T, typename ...Ts, typename ...Ints>
constexpr int platform_lookup(int I, Ints... Is)
inline PyArray_Proxy *array_proxy(void *ptr)
inline const PyArray_Proxy *array_proxy(const void *ptr)
inline PyArrayDescr_Proxy *array_descriptor_proxy(PyObject *ptr)
inline const PyArrayDescr_Proxy *array_descriptor_proxy(const PyObject *ptr)
inline bool check_flags(const void *ptr, int flag)
template<ssize_t Dim = 0, typename Strides>
ssize_t byte_offset_unsafe(const Strides&)
template<ssize_t Dim = 0, typename Strides, typename ...Ix>
ssize_t byte_offset_unsafe(const Strides &strides, ssize_t i, Ix... index)
inline PYBIND11_NOINLINE void register_structured_dtype (any_container< field_descriptor > fields, const std::type_info &tinfo, ssize_t itemsize, bool(*direct_converter)(PyObject *, void *&))
template<class T>
array_iterator<T> array_begin(const buffer_info &buffer)
template<class T>
array_iterator<T> array_end(const buffer_info &buffer)
template<size_t N>
broadcast_trivial broadcast(const std::array<buffer_info, N> &buffers, ssize_t &ndim, std::vector<ssize_t> &shape)
template<typename Func, typename Return, typename ...Args>
vectorize_helper<Func, Return, Args...> vectorize_extractor(const Func &f, Return (*)(Args...))
template<typename Return, typename ...Args>
detail::vectorize_helper<Return (*)(Args...), Return, Args...> vectorize(Return (*f)(Args...))
template<typename Func, detail::enable_if_t<detail::is_lambda<Func>::value, int> = 0>
auto vectorize(Func &&f) -> decltype(detail::vectorize_extractor(std::forward<Func>(f), (detail::function_signature_t<Func>*)nullptr))
template<typename Return, typename Class, typename ...Args, typename Helper = detail::vectorize_helper<decltype(std::mem_fn(std::declval<Return (Class::*)(Args...)>())), Return, Class*, Args...>>
Helper vectorize(Return (Class::* f)(Args...))
file numpy.h
#include “pybind11.h”#include “complex.h”#include <numeric>#include <algorithm>#include <array>#include <cstdint>#include <cstdlib>#include <cstring>#include <sstream>#include <string>#include <functional>#include <utility>#include <vector>#include <typeindex>

Defines

DECL_NPY_API(Func)
PYBIND11_DECL_CHAR_FMT
PYBIND11_FIELD_DESCRIPTOR_EX(T, Field, Name)
PYBIND11_FIELD_DESCRIPTOR(T, Field)
PYBIND11_EVAL0(...)
PYBIND11_EVAL1(...)
PYBIND11_EVAL2(...)
PYBIND11_EVAL3(...)
PYBIND11_EVAL4(...)
PYBIND11_EVAL(...)
PYBIND11_MAP_END(...)
PYBIND11_MAP_OUT
PYBIND11_MAP_COMMA
PYBIND11_MAP_GET_END()
PYBIND11_MAP_NEXT0(test, next, ...)
PYBIND11_MAP_NEXT1(test, next)
PYBIND11_MAP_NEXT(test, next)
PYBIND11_MAP_LIST_NEXT1(test, next)
PYBIND11_MAP_LIST_NEXT(test, next)
PYBIND11_MAP_LIST0(f, t, x, peek, ...)
PYBIND11_MAP_LIST1(f, t, x, peek, ...)
PYBIND11_MAP_LIST(f, t, ...)
PYBIND11_NUMPY_DTYPE(Type, ...)
PYBIND11_MAP2_LIST_NEXT1(test, next)
PYBIND11_MAP2_LIST_NEXT(test, next)
PYBIND11_MAP2_LIST0(f, t, x1, x2, peek, ...)
PYBIND11_MAP2_LIST1(f, t, x1, x2, peek, ...)
PYBIND11_MAP2_LIST(f, t, ...)
PYBIND11_NUMPY_DTYPE_EX(Type, ...)

Typedefs

using remove_all_extents_t = typename array_info<T>::type
using is_pod_struct = all_of<std::is_standard_layout<T>, std::is_trivially_copyable<T>, satisfies_none_of<T, std::is_reference, std::is_array, is_std_array, std::is_arithmetic, is_complex, std::is_enum>>
using array_iterator = typename std::add_pointer<T>::type

Enums

enum broadcast_trivial

Values:

enumerator non_trivial
enumerator c_trivial
enumerator f_trivial
enumerator non_trivial
enumerator c_trivial
enumerator f_trivial

Functions

inline PYBIND11_NOINLINE void load_numpy_internals (numpy_internals *&ptr)
inline numpy_internals &get_numpy_internals()
template<typename Concrete>
constexpr int platform_lookup()
template<typename Concrete, typename T, typename ...Ts, typename ...Ints>
constexpr int platform_lookup(int I, Ints... Is)
inline PyArray_Proxy *array_proxy(void *ptr)
inline const PyArray_Proxy *array_proxy(const void *ptr)
inline PyArrayDescr_Proxy *array_descriptor_proxy(PyObject *ptr)
inline const PyArrayDescr_Proxy *array_descriptor_proxy(const PyObject *ptr)
inline bool check_flags(const void *ptr, int flag)
template<ssize_t Dim = 0, typename Strides>
ssize_t byte_offset_unsafe(const Strides&)
template<ssize_t Dim = 0, typename Strides, typename ...Ix>
ssize_t byte_offset_unsafe(const Strides &strides, ssize_t i, Ix... index)
inline PYBIND11_NOINLINE void register_structured_dtype (any_container< field_descriptor > fields, const std::type_info &tinfo, ssize_t itemsize, bool(*direct_converter)(PyObject *, void *&))
template<class T>
array_iterator<T> array_begin(const buffer_info &buffer)
template<class T>
array_iterator<T> array_end(const buffer_info &buffer)
template<size_t N>
broadcast_trivial broadcast(const std::array<buffer_info, N> &buffers, ssize_t &ndim, std::vector<ssize_t> &shape)
template<typename Func, typename Return, typename ...Args>
vectorize_helper<Func, Return, Args...> vectorize_extractor(const Func &f, Return (*)(Args...))
template<typename Return, typename ...Args>
detail::vectorize_helper<Return (*)(Args...), Return, Args...> vectorize(Return (*f)(Args...))
template<typename Func, detail::enable_if_t<detail::is_lambda<Func>::value, int> = 0>
auto vectorize(Func &&f) -> decltype(detail::vectorize_extractor(std::forward<Func>(f), (detail::function_signature_t<Func>*)nullptr))
template<typename Return, typename Class, typename ...Args, typename Helper = detail::vectorize_helper<decltype(std::mem_fn(std::declval<Return (Class::*)(Args...)>())), Return, Class*, Args...>>
Helper vectorize(Return (Class::* f)(Args...))
file operators.h
#include “pybind11.h”

Defines

PYBIND11_BINARY_OPERATOR(id, rid, op, expr)
PYBIND11_INPLACE_OPERATOR(id, op, expr)
PYBIND11_UNARY_OPERATOR(id, op, expr)

Enums

enum op_id

Enumeration with all supported operator types.

Values:

enumerator op_add
enumerator op_sub
enumerator op_mul
enumerator op_div
enumerator op_mod
enumerator op_divmod
enumerator op_pow
enumerator op_lshift
enumerator op_rshift
enumerator op_and
enumerator op_xor
enumerator op_or
enumerator op_neg
enumerator op_pos
enumerator op_abs
enumerator op_invert
enumerator op_int
enumerator op_long
enumerator op_float
enumerator op_str
enumerator op_cmp
enumerator op_gt
enumerator op_ge
enumerator op_lt
enumerator op_le
enumerator op_eq
enumerator op_ne
enumerator op_iadd
enumerator op_isub
enumerator op_imul
enumerator op_idiv
enumerator op_imod
enumerator op_ilshift
enumerator op_irshift
enumerator op_iand
enumerator op_ixor
enumerator op_ior
enumerator op_complex
enumerator op_bool
enumerator op_nonzero
enumerator op_repr
enumerator op_truediv
enumerator op_itruediv
enumerator op_hash
enumerator op_add
enumerator op_sub
enumerator op_mul
enumerator op_div
enumerator op_mod
enumerator op_divmod
enumerator op_pow
enumerator op_lshift
enumerator op_rshift
enumerator op_and
enumerator op_xor
enumerator op_or
enumerator op_neg
enumerator op_pos
enumerator op_abs
enumerator op_invert
enumerator op_int
enumerator op_long
enumerator op_float
enumerator op_str
enumerator op_cmp
enumerator op_gt
enumerator op_ge
enumerator op_lt
enumerator op_le
enumerator op_eq
enumerator op_ne
enumerator op_iadd
enumerator op_isub
enumerator op_imul
enumerator op_idiv
enumerator op_imod
enumerator op_ilshift
enumerator op_irshift
enumerator op_iand
enumerator op_ixor
enumerator op_ior
enumerator op_complex
enumerator op_bool
enumerator op_nonzero
enumerator op_repr
enumerator op_truediv
enumerator op_itruediv
enumerator op_hash
enum op_type

Values:

enumerator op_l
enumerator op_r
enumerator op_u
enumerator op_l
enumerator op_r
enumerator op_u

Functions

inline self_t __self()

Don’t warn about an unused variable.

Variables

static const self_t self = self_t()
file operators.h
#include “pybind11.h”

Defines

PYBIND11_BINARY_OPERATOR(id, rid, op, expr)
PYBIND11_INPLACE_OPERATOR(id, op, expr)
PYBIND11_UNARY_OPERATOR(id, op, expr)

Enums

enum op_id

Enumeration with all supported operator types.

Values:

enumerator op_add
enumerator op_sub
enumerator op_mul
enumerator op_div
enumerator op_mod
enumerator op_divmod
enumerator op_pow
enumerator op_lshift
enumerator op_rshift
enumerator op_and
enumerator op_xor
enumerator op_or
enumerator op_neg
enumerator op_pos
enumerator op_abs
enumerator op_invert
enumerator op_int
enumerator op_long
enumerator op_float
enumerator op_str
enumerator op_cmp
enumerator op_gt
enumerator op_ge
enumerator op_lt
enumerator op_le
enumerator op_eq
enumerator op_ne
enumerator op_iadd
enumerator op_isub
enumerator op_imul
enumerator op_idiv
enumerator op_imod
enumerator op_ilshift
enumerator op_irshift
enumerator op_iand
enumerator op_ixor
enumerator op_ior
enumerator op_complex
enumerator op_bool
enumerator op_nonzero
enumerator op_repr
enumerator op_truediv
enumerator op_itruediv
enumerator op_hash
enumerator op_add
enumerator op_sub
enumerator op_mul
enumerator op_div
enumerator op_mod
enumerator op_divmod
enumerator op_pow
enumerator op_lshift
enumerator op_rshift
enumerator op_and
enumerator op_xor
enumerator op_or
enumerator op_neg
enumerator op_pos
enumerator op_abs
enumerator op_invert
enumerator op_int
enumerator op_long
enumerator op_float
enumerator op_str
enumerator op_cmp
enumerator op_gt
enumerator op_ge
enumerator op_lt
enumerator op_le
enumerator op_eq
enumerator op_ne
enumerator op_iadd
enumerator op_isub
enumerator op_imul
enumerator op_idiv
enumerator op_imod
enumerator op_ilshift
enumerator op_irshift
enumerator op_iand
enumerator op_ixor
enumerator op_ior
enumerator op_complex
enumerator op_bool
enumerator op_nonzero
enumerator op_repr
enumerator op_truediv
enumerator op_itruediv
enumerator op_hash
enum op_type

Values:

enumerator op_l
enumerator op_r
enumerator op_u
enumerator op_l
enumerator op_r
enumerator op_u

Functions

inline self_t __self()

Don’t warn about an unused variable.

Variables

static const self_t self = self_t()
file options.h
#include “detail/common.h”
file options.h
#include “detail/common.h”
file pybind11.h
#include “attr.h”#include “options.h”#include “detail/class.h”#include “detail/init.h”

Defines

PYBIND11_ENUM_OP_STRICT(op, expr, strict_behavior)
PYBIND11_ENUM_OP_CONV(op, expr)
PYBIND11_ENUM_OP_CONV_LHS(op, expr)
PYBIND11_THROW
PYBIND11_OVERLOAD_INT(ret_type, cname, name, ...)
PYBIND11_OVERLOAD_NAME(ret_type, cname, name, fn, ...)

Macro to populate the virtual method in the trampoline class.

This macro tries to look up a method named ‘fn’ from the Python side, deals with the :ref:gil and necessary argument conversions to call this method and return the appropriate type. See :ref:overriding_virtuals for more information. This macro should be used when the method name in C is not the same as the method name in Python. For example with __str__.

.. code-block:: cpp

std::string toString() override { PYBIND11_OVERLOAD_NAME( std::string, // Return type (ret_type) Animal, // Parent class (cname) toString, // Name of function in C++ (name) “__str__”, // Name of method in Python (fn) ); }

PYBIND11_OVERLOAD_PURE_NAME(ret_type, cname, name, fn, ...)

Macro for pure virtual functions, this function is identical to :c:macro:PYBIND11_OVERLOAD_NAME, except that it throws if no overload can be found.

PYBIND11_OVERLOAD(ret_type, cname, fn, ...)

Macro to populate the virtual method in the trampoline class.

This macro tries to look up the method from the Python side, deals with the :ref:gil and necessary argument conversions to call this method and return the appropriate type. This macro should be used if the method name in C and in Python are identical. See :ref:overriding_virtuals for more information.

.. code-block:: cpp

class PyAnimal : public Animal { public: Inherit the constructors using Animal::Animal;

Trampoline (need one for each virtual function) std::string go(int n_times) override { PYBIND11_OVERLOAD_PURE( std::string, // Return type (ret_type) Animal, // Parent class (cname) go, // Name of function in C++ (must match Python name) (fn) n_times // Argument(s) (…) ); } };

PYBIND11_OVERLOAD_PURE(ret_type, cname, fn, ...)

Macro for pure virtual functions, this function is identical to :c:macro:PYBIND11_OVERLOAD, except that it throws if no overload can be found.

Functions

inline dict globals()

Return a dictionary representing the global variables in the current execution frame, or __main__.__dict__ if there is no frame (usually when the interpreter is embedded).

template<typename T, typename = void_t<decltype(static_cast<void *(*)(size_t)>(T::operator new))>>
void set_operator_new(type_record *r)

Set the pointer to operator new if it exists. The cast is needed because it can be overloaded.

template<typename>
void set_operator_new(...)
template<typename T, enable_if_t<has_operator_delete<T>::value, int> = 0>
void call_operator_delete(T *p, size_t, size_t)

Call class-specific delete if it exists or global otherwise. Can also be an overload set.

inline void call_operator_delete(void *p, size_t s, size_t a)
template<typename, typename F>
auto method_adaptor(F &&f) -> decltype(std::forward<F>(f))

Given a pointer to a member function, cast it to its Derived version.

Forward everything else unchanged.

template<typename Derived, typename Return, typename Class, typename ...Args>
auto method_adaptor(Return (Class::* pmf)(Args...)) -> Return (Derived::*)(Args...)
template<typename ...Args>
detail::initimpl::constructor<Args...> init()

Binds an existing constructor taking arguments Args…

template<typename ...Args>
detail::initimpl::alias_constructor<Args...> init_alias()

Like init<Args...>(), but the instance is always constructed through the alias class (even when not inheriting on the Python side).

template<typename Func, typename Ret = detail::initimpl::factory<Func>>
Ret init(Func &&f)

Binds a factory function as a constructor.

template<typename CFunc, typename AFunc, typename Ret = detail::initimpl::factory<CFunc, AFunc>>
Ret init(CFunc &&c, AFunc &&a)

Dual-argument factory function: the first function is called when no alias is needed, the second when an alias is needed (i.e.

due to python-side inheritance). Arguments must be identical.

template<typename GetState, typename SetState>
detail::initimpl::pickle_factory<GetState, SetState> pickle(GetState &&g, SetState &&s)

Binds pickling functions __getstate__ and __setstate__ and ensures that the type returned by __getstate__ is the same as the argument accepted by __setstate__.

inline void keep_alive_impl(handle nurse, handle patient)
inline PYBIND11_NOINLINE void keep_alive_impl (size_t Nurse, size_t Patient, function_call &call, handle ret)
inline std::pair< decltype(internals::registered_types_py)::iterator, bool > all_type_info_get_cache (PyTypeObject *type)
template<return_value_policy Policy = return_value_policy::reference_internal, typename Iterator, typename Sentinel, typename ValueType = decltype(*std::declval<Iterator>()), typename ...Extra>
iterator make_iterator(Iterator first, Sentinel last, Extra&&... extra)

Makes a python iterator from a first and past-the-end C++ InputIterator.

template<return_value_policy Policy = return_value_policy::reference_internal, typename Iterator, typename Sentinel, typename KeyType = decltype((*std::declval<Iterator>()).first), typename ...Extra>
iterator make_key_iterator(Iterator first, Sentinel last, Extra&&... extra)

Makes an python iterator over the keys (.first) of a iterator over pairs from a first and past-the-end InputIterator.

template<return_value_policy Policy = return_value_policy::reference_internal, typename Type, typename ...Extra>
iterator make_iterator(Type &value, Extra&&... extra)

Makes an iterator over values of an stl container or other container supporting std::begin()/std::end()

template<return_value_policy Policy = return_value_policy::reference_internal, typename Type, typename ...Extra>
iterator make_key_iterator(Type &value, Extra&&... extra)

Makes an iterator over the keys (.first) of a stl map-like container supporting std::begin()/std::end()

template<typename InputType, typename OutputType>
void implicitly_convertible()
template<typename ExceptionTranslator>
void register_exception_translator(ExceptionTranslator &&translator)
template<typename CppException>
exception<CppException> &get_exception_object()
template<typename CppException>
exception<CppException> &register_exception(handle scope, const char *name, PyObject *base = PyExc_Exception)

Registers a Python exception in m of the given name and installs an exception translator to translate the C++ exception to the created Python exception using the exceptions what() method.

This is intended for simple exception translations; for more complex translation, register the exception object and translator directly.

inline PYBIND11_NOINLINE void print (tuple args, dict kwargs)
template<return_value_policy policy = return_value_policy::automatic_reference, typename ...Args>
void print(Args&&... args)
inline function get_type_overload(const void *this_ptr, const detail::type_info *this_type, const char *name)
template<class T>
function get_overload(const T *this_ptr, const char *name)

Try to retrieve a python method by the provided name from the instance pointed to by the this_ptr.

:this_ptr: The pointer to the object the overload should be retrieved for. This should be the first non-trampoline class encountered in the inheritance chain. :name: The name of the overloaded Python method to retrieve. :return: The Python method by this name from the object or an empty function wrapper.

file pybind11.h
#include “attr.h”#include “options.h”#include “detail/class.h”#include “detail/init.h”

Defines

PYBIND11_ENUM_OP_STRICT(op, expr, strict_behavior)
PYBIND11_ENUM_OP_CONV(op, expr)
PYBIND11_ENUM_OP_CONV_LHS(op, expr)
PYBIND11_THROW
PYBIND11_OVERLOAD_INT(ret_type, cname, name, ...)
PYBIND11_OVERLOAD_NAME(ret_type, cname, name, fn, ...)

Macro to populate the virtual method in the trampoline class.

This macro tries to look up a method named ‘fn’ from the Python side, deals with the :ref:gil and necessary argument conversions to call this method and return the appropriate type. See :ref:overriding_virtuals for more information. This macro should be used when the method name in C is not the same as the method name in Python. For example with __str__.

.. code-block:: cpp

std::string toString() override { PYBIND11_OVERLOAD_NAME( std::string, // Return type (ret_type) Animal, // Parent class (cname) toString, // Name of function in C++ (name) “__str__”, // Name of method in Python (fn) ); }

PYBIND11_OVERLOAD_PURE_NAME(ret_type, cname, name, fn, ...)

Macro for pure virtual functions, this function is identical to :c:macro:PYBIND11_OVERLOAD_NAME, except that it throws if no overload can be found.

PYBIND11_OVERLOAD(ret_type, cname, fn, ...)

Macro to populate the virtual method in the trampoline class.

This macro tries to look up the method from the Python side, deals with the :ref:gil and necessary argument conversions to call this method and return the appropriate type. This macro should be used if the method name in C and in Python are identical. See :ref:overriding_virtuals for more information.

.. code-block:: cpp

class PyAnimal : public Animal { public: Inherit the constructors using Animal::Animal;

Trampoline (need one for each virtual function) std::string go(int n_times) override { PYBIND11_OVERLOAD_PURE( std::string, // Return type (ret_type) Animal, // Parent class (cname) go, // Name of function in C++ (must match Python name) (fn) n_times // Argument(s) (…) ); } };

PYBIND11_OVERLOAD_PURE(ret_type, cname, fn, ...)

Macro for pure virtual functions, this function is identical to :c:macro:PYBIND11_OVERLOAD, except that it throws if no overload can be found.

Functions

inline dict globals()

Return a dictionary representing the global variables in the current execution frame, or __main__.__dict__ if there is no frame (usually when the interpreter is embedded).

template<typename T, typename = void_t<decltype(static_cast<void *(*)(size_t)>(T::operator new))>>
void set_operator_new(type_record *r)

Set the pointer to operator new if it exists. The cast is needed because it can be overloaded.

template<typename>
void set_operator_new(...)
template<typename T, enable_if_t<has_operator_delete<T>::value, int> = 0>
void call_operator_delete(T *p, size_t, size_t)

Call class-specific delete if it exists or global otherwise. Can also be an overload set.

inline void call_operator_delete(void *p, size_t s, size_t a)
template<typename, typename F>
auto method_adaptor(F &&f) -> decltype(std::forward<F>(f))

Given a pointer to a member function, cast it to its Derived version.

Forward everything else unchanged.

template<typename Derived, typename Return, typename Class, typename ...Args>
auto method_adaptor(Return (Class::* pmf)(Args...)) -> Return (Derived::*)(Args...)
template<typename ...Args>
detail::initimpl::constructor<Args...> init()

Binds an existing constructor taking arguments Args…

template<typename ...Args>
detail::initimpl::alias_constructor<Args...> init_alias()

Like init<Args...>(), but the instance is always constructed through the alias class (even when not inheriting on the Python side).

template<typename Func, typename Ret = detail::initimpl::factory<Func>>
Ret init(Func &&f)

Binds a factory function as a constructor.

template<typename CFunc, typename AFunc, typename Ret = detail::initimpl::factory<CFunc, AFunc>>
Ret init(CFunc &&c, AFunc &&a)

Dual-argument factory function: the first function is called when no alias is needed, the second when an alias is needed (i.e.

due to python-side inheritance). Arguments must be identical.

template<typename GetState, typename SetState>
detail::initimpl::pickle_factory<GetState, SetState> pickle(GetState &&g, SetState &&s)

Binds pickling functions __getstate__ and __setstate__ and ensures that the type returned by __getstate__ is the same as the argument accepted by __setstate__.

inline void keep_alive_impl(handle nurse, handle patient)
inline PYBIND11_NOINLINE void keep_alive_impl (size_t Nurse, size_t Patient, function_call &call, handle ret)
inline std::pair< decltype(internals::registered_types_py)::iterator, bool > all_type_info_get_cache (PyTypeObject *type)
template<return_value_policy Policy = return_value_policy::reference_internal, typename Iterator, typename Sentinel, typename ValueType = decltype(*std::declval<Iterator>()), typename ...Extra>
iterator make_iterator(Iterator first, Sentinel last, Extra&&... extra)

Makes a python iterator from a first and past-the-end C++ InputIterator.

template<return_value_policy Policy = return_value_policy::reference_internal, typename Iterator, typename Sentinel, typename KeyType = decltype((*std::declval<Iterator>()).first), typename ...Extra>
iterator make_key_iterator(Iterator first, Sentinel last, Extra&&... extra)

Makes an python iterator over the keys (.first) of a iterator over pairs from a first and past-the-end InputIterator.

template<return_value_policy Policy = return_value_policy::reference_internal, typename Type, typename ...Extra>
iterator make_iterator(Type &value, Extra&&... extra)

Makes an iterator over values of an stl container or other container supporting std::begin()/std::end()

template<return_value_policy Policy = return_value_policy::reference_internal, typename Type, typename ...Extra>
iterator make_key_iterator(Type &value, Extra&&... extra)

Makes an iterator over the keys (.first) of a stl map-like container supporting std::begin()/std::end()

template<typename InputType, typename OutputType>
void implicitly_convertible()
template<typename ExceptionTranslator>
void register_exception_translator(ExceptionTranslator &&translator)
template<typename CppException>
exception<CppException> &get_exception_object()
template<typename CppException>
exception<CppException> &register_exception(handle scope, const char *name, PyObject *base = PyExc_Exception)

Registers a Python exception in m of the given name and installs an exception translator to translate the C++ exception to the created Python exception using the exceptions what() method.

This is intended for simple exception translations; for more complex translation, register the exception object and translator directly.

inline PYBIND11_NOINLINE void print (tuple args, dict kwargs)
template<return_value_policy policy = return_value_policy::automatic_reference, typename ...Args>
void print(Args&&... args)
inline function get_type_overload(const void *this_ptr, const detail::type_info *this_type, const char *name)
template<class T>
function get_overload(const T *this_ptr, const char *name)

Try to retrieve a python method by the provided name from the instance pointed to by the this_ptr.

:this_ptr: The pointer to the object the overload should be retrieved for. This should be the first non-trampoline class encountered in the inheritance chain. :name: The name of the overloaded Python method to retrieve. :return: The Python method by this name from the object or an empty function wrapper.

file pytypes.h
#include “detail/common.h”#include “buffer_info.h”#include <utility>#include <type_traits>

Defines

PYBIND11_OBJECT_COMMON(Name, Parent, CheckFun)
PYBIND11_OBJECT_CVT(Name, Parent, CheckFun, ConvertFun)
PYBIND11_OBJECT(Name, Parent, CheckFun)
PYBIND11_OBJECT_DEFAULT(Name, Parent, CheckFun)
PYBIND11_MATH_OPERATOR_UNARY(op, fn)
PYBIND11_MATH_OPERATOR_BINARY(op, fn)

Typedefs

using obj_attr_accessor = accessor<accessor_policies::obj_attr>
using str_attr_accessor = accessor<accessor_policies::str_attr>
using item_accessor = accessor<accessor_policies::generic_item>
using sequence_accessor = accessor<accessor_policies::sequence_item>
using list_accessor = accessor<accessor_policies::list_item>
using tuple_accessor = accessor<accessor_policies::tuple_item>
using is_pyobject = std::is_base_of<pyobject_tag, remove_reference_t<T>>
using tuple_iterator = generic_iterator<iterator_policies::sequence_fast_readonly>
using list_iterator = generic_iterator<iterator_policies::sequence_fast_readonly>
using sequence_iterator = generic_iterator<iterator_policies::sequence_slow_readwrite>
using dict_iterator = generic_iterator<iterator_policies::dict_readonly>
using is_keyword = std::is_base_of<arg, T>

Python argument categories (using PEP 448 terms)

using is_s_unpacking = std::is_same<args_proxy, T>
using is_ds_unpacking = std::is_same<kwargs_proxy, T>
using is_positional = satisfies_none_of<T, is_keyword, is_s_unpacking, is_ds_unpacking>
using is_keyword_or_ds = satisfies_any_of<T, is_keyword, is_ds_unpacking>

Functions

inline bool isinstance_generic(handle obj, const std::type_info &tp)
template<typename T>
T reinterpret_borrow(handle h)

Declare that a handle or PyObject * is a certain type and borrow the reference.

The target type T must be object or one of its derived classes. The function doesn’t do any conversions or checks. It’s up to the user to make sure that the target type is correct.

.. code-block:: cpp

PyObject *p = PyList_GetItem(obj, index);
py::object o = reinterpret_borrow<py::object>(p);
or py::tuple t = reinterpret_borrow<py::tuple>(p); // < p must be already be a tuple

template<typename T>
T reinterpret_steal(handle h)

Like reinterpret_borrow, but steals the reference.

.. code-block:: cpp

PyObject *p = PyObject_Str(obj); py::str s = reinterpret_steal<py::str>(p); // < p must be already be a str

inline std::string error_string()
template<typename T, detail::enable_if_t<std::is_base_of<object, T>::value, int> = 0>
bool isinstance(handle obj)

Return true if obj is an instance of T.

Type T must be a subclass of object or a class which was exposed to Python as py::class_<T>.

template<>
inline bool isinstance<handle>(handle obj) = delete
template<>
inline bool isinstance<object>(handle obj)
inline bool isinstance(handle obj, handle type)

Return true if obj is an instance of the type.

inline bool hasattr(handle obj, handle name)
inline bool hasattr(handle obj, const char *name)
inline void delattr(handle obj, handle name)
inline void delattr(handle obj, const char *name)
inline object getattr(handle obj, handle name)
inline object getattr(handle obj, const char *name)
inline object getattr(handle obj, handle name, handle default_)
inline object getattr(handle obj, const char *name, handle default_)
inline void setattr(handle obj, handle name, handle value)
inline void setattr(handle obj, const char *name, handle value)
inline ssize_t hash(handle obj)
inline handle get_function(handle value)
template<typename T, enable_if_t<is_pyobject<T>::value, int> = 0>
auto object_or_cast(T &&o) -> decltype(std::forward<T>(o))
template<typename T, enable_if_t<!is_pyobject<T>::value, int> = 0>
object object_or_cast(T &&o)
inline handle object_or_cast(PyObject *ptr)
inline bool PyIterable_Check(PyObject *obj)
inline bool PyNone_Check(PyObject *o)
inline bool PyUnicode_Check_Permissive(PyObject *o)
inline bool PyStaticMethod_Check(PyObject *o)
template<typename Unsigned>
Unsigned as_unsigned(PyObject *o)
inline size_t len(handle h)
inline size_t len_hint(handle h)
inline str repr(handle h)
inline iterator iter(handle obj)
file pytypes.h
#include “detail/common.h”#include “buffer_info.h”#include <utility>#include <type_traits>

Defines

PYBIND11_OBJECT_COMMON(Name, Parent, CheckFun)
PYBIND11_OBJECT_CVT(Name, Parent, CheckFun, ConvertFun)
PYBIND11_OBJECT(Name, Parent, CheckFun)
PYBIND11_OBJECT_DEFAULT(Name, Parent, CheckFun)
PYBIND11_MATH_OPERATOR_UNARY(op, fn)
PYBIND11_MATH_OPERATOR_BINARY(op, fn)

Typedefs

using obj_attr_accessor = accessor<accessor_policies::obj_attr>
using str_attr_accessor = accessor<accessor_policies::str_attr>
using item_accessor = accessor<accessor_policies::generic_item>
using sequence_accessor = accessor<accessor_policies::sequence_item>
using list_accessor = accessor<accessor_policies::list_item>
using tuple_accessor = accessor<accessor_policies::tuple_item>
using is_pyobject = std::is_base_of<pyobject_tag, remove_reference_t<T>>
using tuple_iterator = generic_iterator<iterator_policies::sequence_fast_readonly>
using list_iterator = generic_iterator<iterator_policies::sequence_fast_readonly>
using sequence_iterator = generic_iterator<iterator_policies::sequence_slow_readwrite>
using dict_iterator = generic_iterator<iterator_policies::dict_readonly>
using is_keyword = std::is_base_of<arg, T>

Python argument categories (using PEP 448 terms)

using is_s_unpacking = std::is_same<args_proxy, T>
using is_ds_unpacking = std::is_same<kwargs_proxy, T>
using is_positional = satisfies_none_of<T, is_keyword, is_s_unpacking, is_ds_unpacking>
using is_keyword_or_ds = satisfies_any_of<T, is_keyword, is_ds_unpacking>

Functions

inline bool isinstance_generic(handle obj, const std::type_info &tp)
template<typename T>
T reinterpret_borrow(handle h)

Declare that a handle or PyObject * is a certain type and borrow the reference.

The target type T must be object or one of its derived classes. The function doesn’t do any conversions or checks. It’s up to the user to make sure that the target type is correct.

.. code-block:: cpp

PyObject *p = PyList_GetItem(obj, index);
py::object o = reinterpret_borrow<py::object>(p);
or py::tuple t = reinterpret_borrow<py::tuple>(p); // < p must be already be a tuple

template<typename T>
T reinterpret_steal(handle h)

Like reinterpret_borrow, but steals the reference.

.. code-block:: cpp

PyObject *p = PyObject_Str(obj); py::str s = reinterpret_steal<py::str>(p); // < p must be already be a str

inline std::string error_string()
template<typename T, detail::enable_if_t<std::is_base_of<object, T>::value, int> = 0>
bool isinstance(handle obj)

Return true if obj is an instance of T.

Type T must be a subclass of object or a class which was exposed to Python as py::class_<T>.

template<typename T, detail::enable_if_t<!std::is_base_of<object, T>::value, int> = 0>
bool isinstance(handle obj)
template<>
inline bool isinstance<handle>(handle obj) = delete
template<>
inline bool isinstance<object>(handle obj)
inline bool isinstance(handle obj, handle type)

Return true if obj is an instance of the type.

inline bool hasattr(handle obj, handle name)
inline bool hasattr(handle obj, const char *name)
inline void delattr(handle obj, handle name)
inline void delattr(handle obj, const char *name)
inline object getattr(handle obj, handle name)
inline object getattr(handle obj, const char *name)
inline object getattr(handle obj, handle name, handle default_)
inline object getattr(handle obj, const char *name, handle default_)
inline void setattr(handle obj, handle name, handle value)
inline void setattr(handle obj, const char *name, handle value)
inline ssize_t hash(handle obj)
inline handle get_function(handle value)
template<typename T, enable_if_t<is_pyobject<T>::value, int> = 0>
auto object_or_cast(T &&o) -> decltype(std::forward<T>(o))
template<typename T, enable_if_t<!is_pyobject<T>::value, int> = 0>
object object_or_cast(T &&o)
inline handle object_or_cast(PyObject *ptr)
inline bool PyIterable_Check(PyObject *obj)
inline bool PyNone_Check(PyObject *o)
inline bool PyUnicode_Check_Permissive(PyObject *o)
inline bool PyStaticMethod_Check(PyObject *o)
template<typename Unsigned>
Unsigned as_unsigned(PyObject *o)
inline size_t len(handle h)
inline size_t len_hint(handle h)
inline str repr(handle h)
inline iterator iter(handle obj)
file stl.h
#include “pybind11.h”#include <set>#include <unordered_set>#include <map>#include <unordered_map>#include <iostream>#include <list>#include <deque>#include <valarray>

Typedefs

using forwarded_type = conditional_t<std::is_lvalue_reference<T>::value, remove_reference_t<U>&, remove_reference_t<U>&&>

Extracts an const lvalue reference or rvalue reference for U based on the type of T (e.g.

for forwarding a container element). Typically used indirect via forwarded_type(), below.

Functions

template<typename T, typename U>
forwarded_type<T, U> forward_like(U &&u)

Forwards a value U as rvalue or lvalue according to whether T is rvalue or lvalue; typically used for forwarding a container’s elements.

inline std::ostream &operator<<(std::ostream &os, const handle &obj)
file stl.h
#include “pybind11.h”#include <set>#include <unordered_set>#include <map>#include <unordered_map>#include <iostream>#include <list>#include <deque>#include <valarray>

Typedefs

using forwarded_type = conditional_t<std::is_lvalue_reference<T>::value, remove_reference_t<U>&, remove_reference_t<U>&&>

Extracts an const lvalue reference or rvalue reference for U based on the type of T (e.g.

for forwarding a container element). Typically used indirect via forwarded_type(), below.

Functions

template<typename T, typename U>
forwarded_type<T, U> forward_like(U &&u)

Forwards a value U as rvalue or lvalue according to whether T is rvalue or lvalue; typically used for forwarding a container’s elements.

inline std::ostream &operator<<(std::ostream &os, const handle &obj)
file stl_bind.h
#include “detail/common.h”#include “operators.h”#include <algorithm>#include <sstream>

Typedefs

using vector_needs_copy = negation<std::is_same<decltype(std::declval<Vector>()[typename Vector::size_type()]), typename Vector::value_type&>>

Functions

template<typename, typename, typename ...Args>
void vector_if_copy_constructible(const Args&...)
template<typename, typename, typename ...Args>
void vector_if_equal_operator(const Args&...)
template<typename, typename, typename ...Args>
void vector_if_insertion_operator(const Args&...)
template<typename, typename, typename ...Args>
void vector_modifiers(const Args&...)
template<typename Vector, typename Class_>
void vector_if_copy_constructible(enable_if_t<is_copy_constructible<Vector>::value, Class_> &cl)
template<typename Vector, typename Class_>
void vector_if_equal_operator(enable_if_t<is_comparable<Vector>::value, Class_> &cl)
template<typename Vector, typename Class_>
void vector_modifiers(enable_if_t<is_copy_constructible<typename Vector::value_type>::value, Class_> &cl)
template<typename Vector, typename Class_>
void vector_accessor(enable_if_t<!vector_needs_copy<Vector>::value, Class_> &cl)
template<typename Vector, typename Class_>
void vector_accessor(enable_if_t<vector_needs_copy<Vector>::value, Class_> &cl)
template<typename Vector, typename Class_>
auto vector_if_insertion_operator(Class_ &cl, std::string const &name) -> decltype(std::declval<std::ostream&>() << std::declval<typename Vector::value_type>(), void())
template<typename Vector, typename Class_, typename ...Args>
enable_if_t<detail::any_of<std::is_same<Args, buffer_protocol>...>::value> vector_buffer(Class_ &cl)
template<typename Vector, typename Class_, typename ...Args>
enable_if_t<!detail::any_of<std::is_same<Args, buffer_protocol>...>::value> vector_buffer(Class_&)
template<typename Vector, typename holder_type = std::unique_ptr<Vector>, typename ...Args>
class_<Vector, holder_type> bind_vector(handle scope, std::string const &name, Args&&... args)
template<typename, typename, typename ...Args>
void map_if_insertion_operator(const Args&...)
template<typename, typename, typename ...Args>
void map_assignment(const Args&...)
template<typename Map, typename Class_>
void map_assignment(enable_if_t<is_copy_assignable<typename Map::mapped_type>::value, Class_> &cl)
template<typename Map, typename Class_>
void map_assignment(enable_if_t<!is_copy_assignable<typename Map::mapped_type>::value && is_copy_constructible<typename Map::mapped_type>::value, Class_> &cl)
template<typename Map, typename Class_>
auto map_if_insertion_operator(Class_ &cl, std::string const &name) -> decltype(std::declval<std::ostream&>() << std::declval<typename Map::key_type>() << std::declval<typename Map::mapped_type>(), void())
template<typename Map, typename holder_type = std::unique_ptr<Map>, typename ...Args>
class_<Map, holder_type> bind_map(handle scope, const std::string &name, Args&&... args)
file stl_bind.h
#include “detail/common.h”#include “operators.h”#include <algorithm>#include <sstream>

Typedefs

using vector_needs_copy = negation<std::is_same<decltype(std::declval<Vector>()[typename Vector::size_type()]), typename Vector::value_type&>>

Functions

template<typename, typename, typename ...Args>
void vector_if_copy_constructible(const Args&...)
template<typename, typename, typename ...Args>
void vector_if_equal_operator(const Args&...)
template<typename, typename, typename ...Args>
void vector_if_insertion_operator(const Args&...)
template<typename, typename, typename ...Args>
void vector_modifiers(const Args&...)
template<typename Vector, typename Class_>
void vector_if_copy_constructible(enable_if_t<is_copy_constructible<Vector>::value, Class_> &cl)
template<typename Vector, typename Class_>
void vector_if_equal_operator(enable_if_t<is_comparable<Vector>::value, Class_> &cl)
template<typename Vector, typename Class_>
void vector_modifiers(enable_if_t<is_copy_constructible<typename Vector::value_type>::value, Class_> &cl)
template<typename Vector, typename Class_>
void vector_accessor(enable_if_t<!vector_needs_copy<Vector>::value, Class_> &cl)
template<typename Vector, typename Class_>
void vector_accessor(enable_if_t<vector_needs_copy<Vector>::value, Class_> &cl)
template<typename Vector, typename Class_>
auto vector_if_insertion_operator(Class_ &cl, std::string const &name) -> decltype(std::declval<std::ostream&>() << std::declval<typename Vector::value_type>(), void())
template<typename Vector, typename Class_, typename ...Args>
enable_if_t<detail::any_of<std::is_same<Args, buffer_protocol>...>::value> vector_buffer(Class_ &cl)
template<typename Vector, typename Class_, typename ...Args>
enable_if_t<!detail::any_of<std::is_same<Args, buffer_protocol>...>::value> vector_buffer(Class_&)
template<typename Vector, typename holder_type = std::unique_ptr<Vector>, typename ...Args>
class_<Vector, holder_type> bind_vector(handle scope, std::string const &name, Args&&... args)
template<typename, typename, typename ...Args>
void map_if_insertion_operator(const Args&...)
template<typename, typename, typename ...Args>
void map_assignment(const Args&...)
template<typename Map, typename Class_>
void map_assignment(enable_if_t<is_copy_assignable<typename Map::mapped_type>::value, Class_> &cl)
template<typename Map, typename Class_>
void map_assignment(enable_if_t<!is_copy_assignable<typename Map::mapped_type>::value && is_copy_constructible<typename Map::mapped_type>::value, Class_> &cl)
template<typename Map, typename Class_>
auto map_if_insertion_operator(Class_ &cl, std::string const &name) -> decltype(std::declval<std::ostream&>() << std::declval<typename Map::key_type>() << std::declval<typename Map::mapped_type>(), void())
template<typename Map, typename holder_type = std::unique_ptr<Map>, typename ...Args>
class_<Map, holder_type> bind_map(handle scope, const std::string &name, Args&&... args)
file yaml_cpp_fwd.hpp
#include <yaml-cpp/yaml.h>#include “yaml_utils/yaml_eigen.hpp”#include “yaml_utils/yaml_tools.hpp”
file yaml_cpp_fwd.hpp
#include <yaml-cpp/yaml.h>#include “yaml_utils/yaml_eigen.hpp”#include “yaml_utils/yaml_tools.hpp”
file yaml_eigen.hpp
#include <type_traits>#include <iomanip>#include <Eigen/Eigen>#include <yaml-cpp/yaml.h>
file yaml_eigen.hpp
#include <type_traits>#include <iomanip>#include <Eigen/Eigen>#include <yaml-cpp/yaml.h>
file yaml_tools.hpp
#include “yaml_utils/yaml_eigen.hpp”
file yaml_tools.hpp
#include “yaml_utils/yaml_eigen.hpp”
file gmock-all.cc
#include “gmock/gmock.h”#include “src/gmock-cardinalities.cc”#include “src/gmock-internal-utils.cc”#include “src/gmock-matchers.cc”#include “src/gmock-spec-builders.cc”#include “src/gmock.cc”
file gmock-cardinalities.cc
#include “gmock/gmock-cardinalities.h”#include <limits.h>#include <ostream>#include <sstream>#include <string>#include “gmock/internal/gmock-internal-utils.h”#include “gtest/gtest.h”

Variables

const int min_
const int max_
file gmock-internal-utils.cc
#include “gmock/internal/gmock-internal-utils.h”#include <ctype.h>#include <ostream>#include <string>#include “gmock/gmock.h”#include “gmock/internal/gmock-port.h”#include “gtest/gtest.h”
file gmock-matchers.cc
#include “gmock/gmock-matchers.h”#include <string.h>#include <iostream>#include <sstream>#include <string>
file gmock-spec-builders.cc
#include “gmock/gmock-spec-builders.h”#include <stdlib.h>#include <iostream>#include <map>#include <memory>#include <set>#include <string>#include <vector>#include “gmock/gmock.h”#include “gtest/gtest.h”#include “gtest/internal/gtest-port.h”

Variables

const char *first_used_file
int first_used_line
::std::string first_used_test_suite
::std::string first_used_test
bool leakable
FunctionMockers function_mockers
StateMap states_
file gmock.cc
#include “gmock/gmock.h”#include “gmock/internal/gmock-port.h”
file gmock_main.cc
#include <iostream>#include “gmock/gmock.h”#include “gtest/gtest.h”

Functions

GTEST_API_ int main (int argc, char **argv)
file gmock-actions_test.cc
#include “gmock/gmock-actions.h”#include <algorithm>#include <iterator>#include <memory>#include <string>#include <type_traits>#include “gmock/gmock.h”#include “gmock/internal/gmock-port.h”#include “gtest/gtest.h”#include “gtest/gtest-spi.h”
file gmock-cardinalities_test.cc
#include “gmock/gmock.h”#include “gtest/gtest.h”#include “gtest/gtest-spi.h”
file gmock-function-mocker_test.cc
#include “gmock/gmock-function-mocker.h”#include <functional>#include <map>#include <string>#include <type_traits>#include “gmock/gmock.h”#include “gtest/gtest.h”

Defines

MY_MOCK_METHODS1_
LEGACY_MY_MOCK_METHODS1_
MY_MOCK_METHODS2_
file gmock-internal-utils_test.cc
#include “gmock/internal/gmock-internal-utils.h”#include <stdlib.h>#include <cstdint>#include <map>#include <memory>#include <sstream>#include <string>#include <vector>#include “gmock/gmock.h”#include “gmock/internal/gmock-port.h”#include “gtest/gtest-spi.h”#include “gtest/gtest.h”#include “src/gtest-internal-inl.h”

Defines

GTEST_IMPLEMENTATION_

Variables

std::string original_verbose_
file gmock-matchers_test.cc
#include “gmock/gmock-matchers.h”#include <string.h>#include <time.h>#include <array>#include <cstdint>#include <deque>#include <forward_list>#include <functional>#include <iostream>#include <iterator>#include <limits>#include <list>#include <map>#include <memory>#include <set>#include <sstream>#include <string>#include <type_traits>#include <unordered_map>#include <unordered_set>#include <utility>#include <vector>#include “gmock/gmock-more-matchers.h”#include “gmock/gmock.h”#include “gtest/gtest-spi.h”#include “gtest/gtest.h”

Variables

int rhs_
static const int kInt = 1
int value_
int value
int i
char c_
int i_
int member_1
std::string member_2
int threshold_
int number_
const Bits max_ulps_
const Bits zero_bits_
const Bits one_bits_
const Bits infinity_bits_
const RawType close_to_positive_zero_
const RawType close_to_negative_zero_
const RawType further_from_negative_zero_
const RawType close_to_one_
const RawType further_from_one_
const RawType infinity_
const RawType close_to_infinity_
const RawType further_from_infinity_
const RawType max_
const RawType nan1_
const RawType nan2_
T *val_
int x
const double y
Uncopyable z
const char *p
char ch
int n_
std::string s_
static double x_
int k_
int divider_
std::list<value_type>::iterator pos_
mutable std::list<value_type> remainder_
static const size_t kUnused = static_cast<size_t>(-1)
const Graph *graph_
std::vector<size_t> lhs_used_
std::vector<size_t> rhs_used_
ElementMatcherPairs matches_
ElementMatcherPairs best_so_far_
bool has_value_
bool has_int_
int index_
file gmock-more-actions_test.cc
#include “gmock/gmock-more-actions.h”#include <functional>#include <memory>#include <sstream>#include <string>#include “gmock/gmock.h”#include “gtest/gtest-spi.h”#include “gtest/gtest.h”
file gmock-nice-strict_test.cc
#include “gmock/gmock-nice-strict.h”#include <string>#include <utility>#include “gmock/gmock.h”#include “gtest/gtest-spi.h”#include “gtest/gtest.h”
file gmock-port_test.cc
#include “gmock/internal/gmock-port.h”#include “gtest/gtest.h”

Functions

TEST(DummyTest, Dummy)
file gmock-pp-string_test.cc
#include “gmock/internal/gmock-pp.h”#include <string>#include “gmock/gmock.h”

Defines

EXPECT_EXPANSION(Result, Macro)
GMOCK_PP_INTERNAL_IS_EMPTY_TEST_1
JOINER_CAT(a, b)
JOINER(_N, _Data, _Elem)
file gmock-pp_test.cc
#include “gmock/internal/gmock-pp.h”

Defines

GMOCK_TEST_REPLACE_comma_WITH_COMMA_I_comma
GMOCK_TEST_REPLACE_comma_WITH_COMMA(x)
GMOCK_PP_INTERNAL_TYPE_TEST(_i, _Data, _element)
GMOCK_PP_INTERNAL_VAR_TEST_1(_x)
GMOCK_PP_INTERNAL_VAR_TEST_2(_x, _y)
GMOCK_PP_INTERNAL_VAR_TEST_3(_x, _y, _z)
GMOCK_PP_INTERNAL_VAR_TEST(...)
GMOCK_PP_INTERNAL_IS_EMPTY_TEST_1
file gmock-spec-builders_test.cc
#include “gmock/gmock-spec-builders.h”#include <memory>#include <ostream>#include <sstream>#include <string>#include “gmock/gmock.h”#include “gmock/internal/gmock-port.h”#include “gtest/gtest.h”#include “gtest/gtest-spi.h”#include “gtest/internal/gtest-port.h”

Defines

Method

Functions

int main(int argc, char **argv)
file gmock_all_test.cc
#include “test/gmock-actions_test.cc”#include “test/gmock-cardinalities_test.cc”#include “test/gmock-internal-utils_test.cc”#include “test/gmock-matchers_test.cc”#include “test/gmock-more-actions_test.cc”#include “test/gmock-nice-strict_test.cc”#include “test/gmock-port_test.cc”#include “test/gmock-spec-builders_test.cc”#include “test/gmock_test.cc”
file gmock_ex_test.cc
#include “gmock/gmock.h”#include “gtest/gtest.h”
file gmock_leak_test_.cc
#include “gmock/gmock.h”
file gmock_link2_test.cc
#include “test/gmock_link_test.h”

Defines

LinkTest
file gmock_link_test.cc
#include “test/gmock_link_test.h”

Defines

LinkTest
file gmock_link_test.h
#include “gmock/gmock.h”#include <errno.h>#include <iostream>#include <vector>#include “gtest/gtest.h”#include “gtest/internal/gtest-port.h”

Functions

TEST(LinkTest, TestReturnVoid)
TEST(LinkTest, TestReturn)
TEST(LinkTest, TestReturnNull)
TEST(LinkTest, TestReturnRef)
TEST(LinkTest, TestAssign)
TEST(LinkTest, TestSetArgPointee)
TEST(LinkTest, TestSetArrayArgument)
TEST(LinkTest, TestSetErrnoAndReturn)
TEST(LinkTest, TestInvoke)
TEST(LinkTest, TestInvokeWithoutArgs)
TEST(LinkTest, TestInvokeArgument)
TEST(LinkTest, TestWithArg)
TEST(LinkTest, TestWithArgs)
TEST(LinkTest, TestWithoutArgs)
TEST(LinkTest, TestDoAll)
TEST(LinkTest, TestDoDefault)
TEST(LinkTest, TestIgnoreResult)
TEST(LinkTest, TestActionMacro)
TEST(LinkTest, TestActionPMacro)
TEST(LinkTest, TestActionP2Macro)
TEST(LinkTest, TestMatcherAnything)
TEST(LinkTest, TestMatcherA)
TEST(LinkTest, TestMatchersEq)
TEST(LinkTest, TestMatchersRelations)
TEST(LinkTest, TestMatcherNotNull)
TEST(LinkTest, TestMatcherIsNull)
TEST(LinkTest, TestMatcherRef)
TEST(LinkTest, TestMatcherTypedEq)
TEST(LinkTest, TestMatchersFloatingPoint)
TEST(LinkTest, TestMatcherContainsRegex)
TEST(LinkTest, TestMatcherMatchesRegex)
TEST(LinkTest, TestMatchersSubstrings)
TEST(LinkTest, TestMatchersStringEquality)
TEST(LinkTest, TestMatcherElementsAre)
TEST(LinkTest, TestMatcherElementsAreArray)
TEST(LinkTest, TestMatcherIsSubsetOf)
TEST(LinkTest, TestMatcherIsSupersetOf)
TEST(LinkTest, TestMatcherContainerEq)
TEST(LinkTest, TestMatcherField)
TEST(LinkTest, TestMatcherProperty)
TEST(LinkTest, TestMatcherResultOf)
TEST(LinkTest, TestMatcherPointee)
TEST(LinkTest, TestMatcherTruly)
TEST(LinkTest, TestMatcherAllOf)
TEST(LinkTest, TestMatcherAnyOf)
TEST(LinkTest, TestMatcherNot)
TEST(LinkTest, TestMatcherCast)
file gmock_output_test_.cc
#include “gmock/gmock.h”#include <stdio.h>#include <string>#include “gtest/gtest.h”

Functions

TEST_F(GMockOutputTest, ExpectedCall)
TEST_F(GMockOutputTest, ExpectedCallToVoidFunction)
TEST_F(GMockOutputTest, ExplicitActionsRunOut)
TEST_F(GMockOutputTest, UnexpectedCall)
TEST_F(GMockOutputTest, UnexpectedCallToVoidFunction)
TEST_F(GMockOutputTest, ExcessiveCall)
TEST_F(GMockOutputTest, ExcessiveCallToVoidFunction)
TEST_F(GMockOutputTest, UninterestingCall)
TEST_F(GMockOutputTest, UninterestingCallToVoidFunction)
TEST_F(GMockOutputTest, RetiredExpectation)
TEST_F(GMockOutputTest, UnsatisfiedPrerequisite)
TEST_F(GMockOutputTest, UnsatisfiedPrerequisites)
TEST_F(GMockOutputTest, UnsatisfiedWith)
TEST_F(GMockOutputTest, UnsatisfiedExpectation)
TEST_F(GMockOutputTest, MismatchArguments)
TEST_F(GMockOutputTest, MismatchWith)
TEST_F(GMockOutputTest, MismatchArgumentsAndWith)
TEST_F(GMockOutputTest, UnexpectedCallWithDefaultAction)
TEST_F(GMockOutputTest, ExcessiveCallWithDefaultAction)
TEST_F(GMockOutputTest, UninterestingCallWithDefaultAction)
TEST_F(GMockOutputTest, ExplicitActionsRunOutWithDefaultAction)
TEST_F(GMockOutputTest, CatchesLeakedMocks)
MATCHER_P2 (IsPair, first, second, "")
TEST_F(GMockOutputTest, PrintsMatcher)
void TestCatchesLeakedMocksInAdHocTests()
int main(int argc, char **argv)
file gmock_stress_test.cc
#include “gmock/gmock.h”#include “gtest/gtest.h”

Functions

int main(int argc, char **argv)

Variables

MockFoo *mock_foo
int *count
file gmock_test.cc
#include “gmock/gmock.h”#include <string>#include “gtest/gtest.h”#include “gtest/internal/custom/gtest.h”

Functions

template<typename Char, int M, int N>
void TestInitGoogleMock(const Char *(&argv)[M], const Char *(&new_argv)[N], const ::std::string &expected_gmock_verbose)
TEST(InitGoogleMockTest, ParsesInvalidCommandLine)
TEST(InitGoogleMockTest, ParsesEmptyCommandLine)
TEST(InitGoogleMockTest, ParsesSingleFlag)
TEST(InitGoogleMockTest, ParsesMultipleFlags)
TEST(InitGoogleMockTest, ParsesUnrecognizedFlag)
TEST(InitGoogleMockTest, ParsesGoogleMockFlagAndUnrecognizedFlag)
TEST(WideInitGoogleMockTest, ParsesInvalidCommandLine)
TEST(WideInitGoogleMockTest, ParsesEmptyCommandLine)
TEST(WideInitGoogleMockTest, ParsesSingleFlag)
TEST(WideInitGoogleMockTest, ParsesMultipleFlags)
TEST(WideInitGoogleMockTest, ParsesUnrecognizedFlag)
TEST(WideInitGoogleMockTest, ParsesGoogleMockFlagAndUnrecognizedFlag)
TEST(FlagTest, IsAccessibleInCode)
file prime_tables.h
#include <algorithm>
file sample1.cc
#include “sample1.h”

Functions

int Factorial(int n)
bool IsPrime(int n)
file sample1.h

Functions

int Factorial(int n)
bool IsPrime(int n)
file sample10_unittest.cc
#include <stdio.h>#include <stdlib.h>#include “gtest/gtest.h”

Functions

int main(int argc, char **argv)
file sample1_unittest.cc
#include <limits.h>#include “sample1.h”#include “gtest/gtest.h”
file sample2.cc
#include “sample2.h”#include <string.h>
file sample2.h
#include <string.h>
file sample2_unittest.cc
#include “sample2.h”#include “gtest/gtest.h”
file sample3-inl.h
#include <stddef.h>
file sample3_unittest.cc
#include “sample3-inl.h”#include “gtest/gtest.h”
file sample4.cc
#include <stdio.h>#include “sample4.h”
file sample4.h
file sample4_unittest.cc
#include “sample4.h”#include “gtest/gtest.h”
file sample5_unittest.cc
#include <limits.h>#include <time.h>#include “gtest/gtest.h”#include “sample1.h”#include “sample3-inl.h”
file sample6_unittest.cc
#include “prime_tables.h”#include “gtest/gtest.h”
file sample7_unittest.cc
#include “prime_tables.h”#include “gtest/gtest.h”
file sample8_unittest.cc
#include “prime_tables.h”#include “gtest/gtest.h”
file sample9_unittest.cc
#include <stdio.h>#include “gtest/gtest.h”

Functions

int main(int argc, char **argv)
file gtest-all.cc
#include “gtest/gtest.h”#include “src/gtest.cc”#include “src/gtest-death-test.cc”#include “src/gtest-filepath.cc”#include “src/gtest-matchers.cc”#include “src/gtest-port.cc”#include “src/gtest-printers.cc”#include “src/gtest-test-part.cc”#include “src/gtest-typed-test.cc”
file gtest-death-test.cc
#include “gtest/gtest-death-test.h”#include <functional>#include <utility>#include “gtest/internal/gtest-port.h”#include “gtest/internal/custom/gtest.h”#include “gtest/gtest-message.h”#include “gtest/internal/gtest-string.h”#include “src/gtest-internal-inl.h”
file gtest-filepath.cc
#include “gtest/internal/gtest-filepath.h”#include <stdlib.h>#include “gtest/internal/gtest-port.h”#include “gtest/gtest-message.h”#include <limits.h>#include <climits>#include “gtest/internal/gtest-string.h”

Defines

GTEST_PATH_MAX_
file gtest-internal-inl.h
#include <errno.h>#include <stddef.h>#include <stdlib.h>#include <string.h>#include <algorithm>#include <cstdint>#include <memory>#include <string>#include <vector>#include “gtest/internal/gtest-port.h”#include “gtest/gtest.h”#include “gtest/gtest-spi.h”

Functions

GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251) namespace testing
file gtest-matchers.cc
#include “gtest/internal/gtest-internal.h”#include “gtest/internal/gtest-port.h”#include “gtest/gtest-matchers.h”#include <string>
file gtest-port.cc
#include “gtest/internal/gtest-port.h”#include <limits.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <cstdint>#include <fstream>#include <memory>#include <unistd.h>#include “gtest/gtest-spi.h”#include “gtest/gtest-message.h”#include “gtest/internal/gtest-internal.h”#include “gtest/internal/gtest-string.h”#include “src/gtest-internal-inl.h”
file gtest-printers.cc
#include “gtest/gtest-printers.h”#include <stdio.h>#include <cctype>#include <cstdint>#include <cwchar>#include <ostream>#include <string>#include <type_traits>#include “gtest/internal/gtest-port.h”#include “src/gtest-internal-inl.h”
file gtest-test-part.cc
#include “gtest/gtest-test-part.h”#include “gtest/internal/gtest-port.h”#include “src/gtest-internal-inl.h”
file gtest-typed-test.cc
#include “gtest/gtest-typed-test.h”#include “gtest/gtest.h”
file gtest.cc
#include “gtest/gtest.h”#include “gtest/internal/custom/gtest.h”#include “gtest/gtest-spi.h”#include <ctype.h>#include <stdarg.h>#include <stdio.h>#include <stdlib.h>#include <time.h>#include <wchar.h>#include <wctype.h>#include <algorithm>#include <chrono>#include <cmath>#include <cstdint>#include <iomanip>#include <limits>#include <list>#include <map>#include <ostream>#include <sstream>#include <vector>#include <sys/time.h>#include <unistd.h>#include “src/gtest-internal-inl.h”

Defines

GTEST_REPEATER_METHOD_(Name, Type)
GTEST_REVERSE_REPEATER_METHOD_(Name, Type)

Variables

const CodeLocation loc_
const std::string error_message_
const bool as_error_
IdMap ids_
size_t left_start_
size_t right_start_
size_t adds_
size_t removes_
size_t common_
std::list<std::pair<char, const char*>> hunk_
std::list<std::pair<char, const char*>> hunk_adds_
std::list<std::pair<char, const char*>> hunk_removes_
std::string name_
file gtest_main.cc
#include <cstdio>#include “gtest/gtest.h”

Functions

GTEST_API_ int main (int argc, char **argv)
file googletest-break-on-failure-unittest_.cc
#include “gtest/gtest.h”

Functions

int main(int argc, char **argv)
file googletest-catch-exceptions-test_.cc
#include <stdio.h>#include <stdlib.h>#include “gtest/gtest.h”

Functions

int main(int argc, char **argv)
file googletest-color-test_.cc
#include <stdio.h>#include “gtest/gtest.h”#include “src/gtest-internal-inl.h”

Functions

TEST(GTestColorTest, Dummy)
int main(int argc, char **argv)
file googletest-death-test-test.cc
#include “gtest/gtest-death-test.h”#include “gtest/gtest.h”#include “gtest/internal/gtest-filepath.h”
file googletest-death-test_ex_test.cc
#include “gtest/gtest-death-test.h”#include “gtest/gtest.h”

Functions

int main(int argc, char **argv)
file googletest-env-var-test_.cc
#include <iostream>#include “gtest/gtest.h”#include “src/gtest-internal-inl.h”

Functions

int main(int argc, char **argv)
file googletest-failfast-unittest_.cc
#include “gtest/gtest.h”

Functions

int main(int argc, char **argv)
file googletest-filepath-test.cc
#include “gtest/internal/gtest-filepath.h”#include “gtest/gtest.h”#include “src/gtest-internal-inl.h”

Variables

FilePath testdata_path_
FilePath testdata_file_
FilePath unique_file0_
FilePath unique_file1_
file googletest-filter-unittest_.cc
#include “gtest/gtest.h”

Functions

int main(int argc, char **argv)
file googletest-global-environment-unittest_.cc
#include “gtest/gtest.h”

Functions

int main(int argc, char **argv)
file googletest-list-tests-unittest_.cc
#include “gtest/gtest.h”

Functions

TEST(Foo, Bar1)
TEST(Foo, Bar2)
TEST(Foo, DISABLED_Bar3)
TEST(Abc, Xyz)
TEST(Abc, Def)
TEST(FooBar, Baz)
TEST_F(FooTest, Test1)
TEST_F(FooTest, DISABLED_Test2)
TEST_F(FooTest, Test3)
TEST(FooDeathTest, Test1)
void PrintTo(const MyType &x, std::ostream *os)
TEST_P(ValueParamTest, TestA)
TEST_P(ValueParamTest, TestB)
INSTANTIATE_TEST_SUITE_P (MyInstantiation, ValueParamTest, testing::Values(MyType("one line"), MyType("two\ines"), MyType("a very\oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong line")))
TYPED_TEST_SUITE(TypedTest, MyTypes)
TYPED_TEST(TypedTest, TestA)
TYPED_TEST(TypedTest, TestB)
TYPED_TEST_SUITE_P(TypeParamTest)
TYPED_TEST_P(TypeParamTest, TestA)
TYPED_TEST_P(TypeParamTest, TestB)
REGISTER_TYPED_TEST_SUITE_P(TypeParamTest, TestA, TestB)
INSTANTIATE_TYPED_TEST_SUITE_P(My, TypeParamTest, MyTypes)
int main(int argc, char **argv)
file googletest-listener-test.cc
#include <vector>#include “gtest/gtest.h”#include “gtest/internal/custom/gtest.h”

Functions

void VerifyResults(const std::vector<std::string> &data, const char *const *expected_data, size_t expected_data_size)
int main(int argc, char **argv)

Variables

std::vector<std::string> *g_events = nullptr
file googletest-message-test.cc
#include “gtest/gtest-message.h”#include “gtest/gtest.h”
file googletest-options-test.cc
#include “gtest/gtest.h”#include “src/gtest-internal-inl.h”

Variables

FilePath original_working_dir_
file googletest-output-test_.cc
#include “gtest/gtest-spi.h”#include “gtest/gtest.h”#include “src/gtest-internal-inl.h”#include <stdlib.h>

Typedefs

using NoTests = ParamTest
typedef testing::Types<char, int> TypesForTestWithNames
typedef testing::Types<unsigned char, unsigned int> UnsignedTypes

Functions

void TestEq1(int x)
void TryTestSubroutine()
TEST(PassingTest, PassingTest1)
TEST(PassingTest, PassingTest2)
TEST_P(FailingParamTest, Fails)
INSTANTIATE_TEST_SUITE_P (PrintingFailingParams, FailingParamTest, testing::Values(2))
TEST_P(EmptyBasenameParamInst, Passes)
INSTANTIATE_TEST_SUITE_P (, EmptyBasenameParamInst, testing::Values(1))
TEST(NonfatalFailureTest, EscapesStringOperands)
TEST(NonfatalFailureTest, DiffForLongStrings)
TEST(FatalFailureTest, FatalFailureInSubroutine)
TEST(FatalFailureTest, FatalFailureInNestedSubroutine)
TEST(FatalFailureTest, NonfatalFailureInSubroutine)
TEST(LoggingTest, InterleavingLoggingAndAssertions)
void SubWithoutTrace(int n)
void SubWithTrace(int n)
TEST(SCOPED_TRACETest, AcceptedValues)
TEST(SCOPED_TRACETest, ObeysScopes)
TEST(SCOPED_TRACETest, WorksInLoop)
TEST(SCOPED_TRACETest, WorksInSubroutine)
TEST(SCOPED_TRACETest, CanBeNested)
TEST(SCOPED_TRACETest, CanBeRepeated)
TEST(ScopedTraceTest, WithExplicitFileAndLine)
TEST(DisabledTestsWarningTest, DISABLED_AlsoRunDisabledTestsFlagSuppressesWarning)
void AdHocTest()
int RunAllTests()
TEST_F(NonFatalFailureInFixtureConstructorTest, FailureInConstructor)
TEST_F(FatalFailureInFixtureConstructorTest, FailureInConstructor)
TEST_F(NonFatalFailureInSetUpTest, FailureInSetUp)
TEST_F(FatalFailureInSetUpTest, FailureInSetUp)
TEST(AddFailureAtTest, MessageContainsSpecifiedFileAndLineNumber)
TEST(GtestFailAtTest, MessageContainsSpecifiedFileAndLineNumber)
TEST_F(TEST_F_before_TEST_in_same_test_case, DefinedUsingTEST_F)
TEST(TEST_F_before_TEST_in_same_test_case, DefinedUsingTESTAndShouldFail)
TEST(TEST_before_TEST_F_in_same_test_case, DefinedUsingTEST)
TEST_F(TEST_before_TEST_F_in_same_test_case, DefinedUsingTEST_FAndShouldFail)
TEST(ExpectNonfatalFailureTest, CanReferenceGlobalVariables)
TEST(ExpectNonfatalFailureTest, CanReferenceLocalVariables)
TEST(ExpectNonfatalFailureTest, SucceedsWhenThereIsOneNonfatalFailure)
TEST(ExpectNonfatalFailureTest, FailsWhenThereIsNoNonfatalFailure)
TEST(ExpectNonfatalFailureTest, FailsWhenThereAreTwoNonfatalFailures)
TEST(ExpectNonfatalFailureTest, FailsWhenThereIsOneFatalFailure)
TEST(ExpectNonfatalFailureTest, FailsWhenStatementReturns)
TEST(ExpectFatalFailureTest, CanReferenceGlobalVariables)
TEST(ExpectFatalFailureTest, CanReferenceLocalStaticVariables)
TEST(ExpectFatalFailureTest, SucceedsWhenThereIsOneFatalFailure)
TEST(ExpectFatalFailureTest, FailsWhenThereIsNoFatalFailure)
void FatalFailure()
TEST(ExpectFatalFailureTest, FailsWhenThereAreTwoFatalFailures)
TEST(ExpectFatalFailureTest, FailsWhenThereIsOneNonfatalFailure)
TEST(ExpectFatalFailureTest, FailsWhenStatementReturns)
std::string ParamNameFunc(const testing::TestParamInfo<std::string> &info)
TEST_P(ParamTest, Success)
TEST_P(ParamTest, Failure)
INSTANTIATE_TEST_SUITE_P (PrintingStrings, ParamTest, testing::Values(std::string("a")), ParamNameFunc)
INSTANTIATE_TEST_SUITE_P (ThisIsOdd, NoTests, ::testing::Values("Hello"))
TEST_P(DetectNotInstantiatedTest, Used)
TYPED_TEST_SUITE(TypedTest, testing::Types<int>)
TYPED_TEST(TypedTest, Success)
TYPED_TEST(TypedTest, Failure)
TYPED_TEST_SUITE(TypedTestWithNames, TypesForTestWithNames, TypedTestNames)
TYPED_TEST(TypedTestWithNames, Success)
TYPED_TEST(TypedTestWithNames, Failure)
TYPED_TEST_SUITE_P(TypedTestP)
TYPED_TEST_P(TypedTestP, Success)
TYPED_TEST_P(TypedTestP, Failure)
REGISTER_TYPED_TEST_SUITE_P(TypedTestP, Success, Failure)
INSTANTIATE_TYPED_TEST_SUITE_P(Unsigned, TypedTestP, UnsignedTypes)
INSTANTIATE_TYPED_TEST_SUITE_P(UnsignedCustomName, TypedTestP, UnsignedTypes, TypedTestPNames)
TYPED_TEST_SUITE_P(DetectNotInstantiatedTypesTest)
TYPED_TEST_P(DetectNotInstantiatedTypesTest, Used)
REGISTER_TYPED_TEST_SUITE_P(DetectNotInstantiatedTypesTest, Used)
TEST_F(ExpectFailureTest, ExpectFatalFailure)
TEST_F(ExpectFailureTest, ExpectNonFatalFailure)
TEST_F(ExpectFailureTest, ExpectFatalFailureOnAllThreads)
TEST_F(ExpectFailureTest, ExpectNonFatalFailureOnAllThreads)
int main(int argc, char **argv)

Variables

static const char kGoldenString[] = "\"Line\0 1\"\nLine 2"
int global_integer = 0
auto dynamic_test
file googletest-param-test-invalid-name1-test_.cc
#include “gtest/gtest.h”

Functions

int main(int argc, char *argv[])
file googletest-param-test-invalid-name2-test_.cc
#include “gtest/gtest.h”

Functions

int main(int argc, char *argv[])
file googletest-param-test-test.cc
#include “gtest/gtest.h”#include <algorithm>#include <iostream>#include <list>#include <set>#include <sstream>#include <string>#include <vector>#include “src/gtest-internal-inl.h”#include “test/googletest-param-test-test.h”

Defines

PREFIX_WITH_FOO(test_name)
PREFIX_WITH_MACRO(test_name)

Enums

enum MyEnums

Values:

enumerator ENUM1
enumerator ENUM2
enumerator ENUM3

Functions

template<typename T>
::std::string PrintValue(const T &value)
template<typename T, size_t N>
void VerifyGenerator(const ParamGenerator<T> &generator, const T (&expected_values)[N])
template<typename T>
void VerifyGeneratorIsEmpty(const ParamGenerator<T> &generator)
TEST(IteratorTest, ParamIteratorConformsToForwardIteratorConcept)
TEST(RangeTest, IntRangeWithDefaultStep)
TEST(RangeTest, IntRangeSingleValue)
TEST(RangeTest, IntRangeEmpty)
TEST(RangeTest, IntRangeWithCustomStep)
TEST(RangeTest, IntRangeWithCustomStepOverUpperBound)
TEST(RangeTest, WorksWithACustomType)
TEST(RangeTest, WorksWithACustomTypeWithDifferentIncrementType)
TEST(ValuesInTest, ValuesInArray)
TEST(ValuesInTest, ValuesInConstArray)
TEST(ValuesInTest, ValuesInSingleElementArray)
TEST(ValuesInTest, ValuesInVector)
TEST(ValuesInTest, ValuesInIteratorRange)
TEST(ValuesInTest, ValuesInSingleElementIteratorRange)
TEST(ValuesInTest, ValuesInEmptyIteratorRange)
TEST(ValuesTest, ValuesWorks)
TEST(ValuesTest, ValuesWorksForValuesOfCompatibleTypes)
TEST(ValuesTest, ValuesWorksForMaxLengthList)
TEST(ValuesTest, ValuesWithSingleParameter)
TEST(BoolTest, BoolWorks)
TEST(CombineTest, CombineWithTwoParameters)
TEST(CombineTest, CombineWithThreeParameters)
TEST(CombineTest, CombineWithFirstParameterSingleValue)
TEST(CombineTest, CombineWithSecondParameterSingleValue)
TEST(CombineTest, CombineWithFirstParameterEmptyRange)
TEST(CombineTest, CombineWithSecondParameterEmptyRange)
TEST(CombineTest, CombineWithMaxNumberOfParameters)
TEST(CombineTest, NonDefaultConstructAssign)
TEST(ParamGeneratorTest, AssignmentWorks)
TEST_P(TestGenerationTest, TestsExpandedAndRun)
INSTANTIATE_TEST_SUITE_P(TestExpansionModule, TestGenerationTest, ValuesIn(test_generation_params))
TEST_P(GeneratorEvaluationTest, GeneratorsEvaluatedInMain)
INSTANTIATE_TEST_SUITE_P(GenEvalModule, GeneratorEvaluationTest, Values(GeneratorEvaluationTest::param_value()))
TEST_P(ExternalGeneratorTest, ExternalGenerator)
INSTANTIATE_TEST_SUITE_P(ExternalGeneratorModule, ExternalGeneratorTest, extern_gen)
TEST_P(ExternalInstantiationTest, IsMultipleOf33)
TEST_P(MultipleInstantiationTest, AllowsMultipleInstances)
INSTANTIATE_TEST_SUITE_P (Sequence1, MultipleInstantiationTest, Values(1, 2))
INSTANTIATE_TEST_SUITE_P (Sequence2, MultipleInstantiationTest, Range(3, 5))
TEST_P(InstantiationInMultipleTranslationUnitsTest, IsMultipleOf42)
INSTANTIATE_TEST_SUITE_P (Sequence1, InstantiationInMultipleTranslationUnitsTest, Values(42, 42 *2))
TEST_P(SeparateInstanceTest, TestsRunInSeparateInstances)
INSTANTIATE_TEST_SUITE_P (FourElemSequence, SeparateInstanceTest, Range(1, 4))
TEST_P(NamingTest, TestsReportCorrectNamesAndParameters)
INSTANTIATE_TEST_SUITE_P (ZeroToFiveSequence, NamingTest, Range(0, 5))
TEST_P(PREFIX_WITH_MACRO(NamingTest), PREFIX_WITH_FOO(SomeTestName))
INSTANTIATE_TEST_SUITE_P (FortyTwo, MacroNamingTest, Values(42))
TEST_F(PREFIX_WITH_MACRO(NamingTestNonParametrized), PREFIX_WITH_FOO(SomeTestName))
TEST(MacroNameing, LookupNames)
TEST_P(CustomFunctorNamingTest, CustomTestNames)
INSTANTIATE_TEST_SUITE_P (CustomParamNameFunctor, CustomFunctorNamingTest, Values(std::string("FunctorName")), CustomParamNameFunctor())
INSTANTIATE_TEST_SUITE_P (AllAllowedCharacters, CustomFunctorNamingTest, Values("abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "01234567890_"), CustomParamNameFunctor())
inline std::string CustomParamNameFunction(const ::testing::TestParamInfo<std::string> &inf)
TEST_P(CustomFunctionNamingTest, CustomTestNames)
INSTANTIATE_TEST_SUITE_P (CustomParamNameFunction, CustomFunctionNamingTest, Values(std::string("FunctionName")), CustomParamNameFunction)
INSTANTIATE_TEST_SUITE_P (CustomParamNameFunctionP, CustomFunctionNamingTest, Values(std::string("FunctionNameP")), &CustomParamNameFunction)
TEST_P(CustomLambdaNamingTest, CustomTestNames)
INSTANTIATE_TEST_SUITE_P (CustomParamNameLambda, CustomLambdaNamingTest, Values(std::string("LambdaName")), [](const ::testing::TestParamInfo< std::string > &inf) { return inf.param;})
TEST(CustomNamingTest, CheckNameRegistry)
TEST_P(CustomIntegerNamingTest, TestsReportCorrectNames)
INSTANTIATE_TEST_SUITE_P (PrintToString, CustomIntegerNamingTest, Range(0, 5), ::testing::PrintToStringParamName())
std::ostream &operator<<(std::ostream &stream, const CustomStruct &val)
TEST_P(CustomStructNamingTest, TestsReportCorrectNames)
INSTANTIATE_TEST_SUITE_P (PrintToString, CustomStructNamingTest, Values(CustomStruct(0), CustomStruct(1)), ::testing::PrintToStringParamName())
TEST_P(StatefulNamingTest, TestsReportCorrectNames)
INSTANTIATE_TEST_SUITE_P (StatefulNamingFunctor, StatefulNamingTest, Range(0, 5), StatefulNamingFunctor())
TEST_P(CommentTest, TestsCorrectlyReportUnstreamableParams)
INSTANTIATE_TEST_SUITE_P (InstantiationWithComments, CommentTest, Values(Unstreamable(1)))
TEST_F(NonParameterizedBaseTest, FixtureIsInitialized)
TEST_P(ParameterizedDerivedTest, SeesSequence)
TEST_F(ParameterizedDeathTest, GetParamDiesFromTestF)
INSTANTIATE_TEST_SUITE_P (RangeZeroToFive, ParameterizedDerivedTest, Range(0, 5))
TEST_P(MyEnumTest, ChecksParamMoreThanZero)
INSTANTIATE_TEST_SUITE_P (MyEnumTests, MyEnumTest, ::testing::Values(ENUM1, ENUM2, 0))
int main(int argc, char **argv)

Variables

const int test_generation_params[] = {36, 42, 72}
ParamGenerator<int> extern_gen
file googletest-param-test-test.h
#include “gtest/gtest.h”
file googletest-param-test2-test.cc
#include “gtest/gtest.h”#include “test/googletest-param-test-test.h”

Functions

INSTANTIATE_TEST_SUITE_P (MultiplesOf33, ExternalInstantiationTest, Values(33, 66))
INSTANTIATE_TEST_SUITE_P (Sequence2, InstantiationInMultipleTranslationUnitsTest, Values(42 *3, 42 *4, 42 *5))

Variables

ParamGenerator<int> extern_gen = Values(33)
file googletest-port-test.cc
#include <stdio.h>#include “gtest/internal/gtest-port.h”#include <list>#include <memory>#include <utility>#include <vector>#include “gtest/gtest.h”#include “gtest/gtest-spi.h”#include “src/gtest-internal-inl.h”
file googletest-printers-test.cc
#include <algorithm>#include <cctype>#include <cstdint>#include <cstring>#include <deque>#include <forward_list>#include <limits>#include <list>#include <map>#include <memory>#include <set>#include <sstream>#include <string>#include <unordered_map>#include <unordered_set>#include <utility>#include <vector>#include “gtest/gtest-printers.h”#include “gtest/gtest.h”

Defines

EXPECT_PRINT_TO_STRING_(value, expected_string)

Enums

enum AnonymousEnum

Values:

enumerator kAE1
enumerator kAE2
enum EnumWithoutPrinter

Values:

enumerator kEWP1
enumerator kEWP2
enum EnumWithStreaming

Values:

enumerator kEWS1
enum EnumWithPrintTo

Values:

enumerator kEWPT1

Functions

std::ostream &operator<<(std::ostream &os, EnumWithStreaming e)
void PrintTo(EnumWithPrintTo e, std::ostream *os)
static void operator<<(std::ostream &os, const ParentClass&)
static void operator<<(std::ostream &os, const ChildClassWithStreamOperator&)
inline void operator<<(::std::ostream &os, const StreamableInGlobal&)
void operator<<(::std::ostream &os, const StreamableInGlobal*)

Variables

T value_
const char *data_
size_t size_
file googletest-setuptestsuite-test_.cc
#include “gtest/gtest.h”

Functions

TEST_F(SetupFailTest, NoopPassingTest)
TEST_F(TearDownFailTest, NoopPassingTest)
file googletest-shuffle-test_.cc
#include “gtest/gtest.h”

Functions

int main(int argc, char **argv)
file googletest-test-part-test.cc
#include “gtest/gtest-test-part.h”#include “gtest/gtest.h”
file googletest-throw-on-failure-test_.cc
#include “gtest/gtest.h”#include <stdio.h>#include <stdlib.h>#include <exception>

Functions

void TerminateHandler()
int main(int argc, char **argv)
file googletest-uninitialized-test_.cc
#include “gtest/gtest.h”

Functions

TEST(DummyTest, Dummy)
int main()
file gtest-typed-test2_test.cc
#include <vector>#include “test/gtest-typed-test_test.h”#include “gtest/gtest.h”

Functions

INSTANTIATE_TYPED_TEST_SUITE_P(Vector, ContainerTest, testing::Types<std::vector<int>>)
file gtest-typed-test_test.cc
#include “test/gtest-typed-test_test.h”#include <set>#include <type_traits>#include <vector>#include “gtest/gtest.h”

Typedefs

typedef Types<char, int> TwoTypes
using TypedTestSuitePStateDeathTest = TypedTestSuitePStateTest
typedef Types<short, long> MyTwoTypes
using IntAfterTypedTestSuiteP = int
using IntBeforeRegisterTypedTestSuiteP = int
typedef Types<std::vector<double>, std::set<char>> MyContainers

Functions

TYPED_TEST_SUITE(CommonTest, TwoTypes)
TYPED_TEST(CommonTest, ValuesAreCorrect)
TYPED_TEST(CommonTest, ValuesAreStillCorrect)
TYPED_TEST_SUITE(TypedTest1, int)
TYPED_TEST(TypedTest1, A)
TYPED_TEST_SUITE(TypedTest2, Types<int>)
TYPED_TEST(TypedTest2, A)
TYPED_TEST_SUITE(TypedTestWithNames, TwoTypes, TypedTestNames)
TYPED_TEST(TypedTestWithNames, TestSuiteName)
TEST_F(TypedTestSuitePStateTest, SucceedsForMatchingList)
TEST_F(TypedTestSuitePStateTest, IgnoresOrderAndSpaces)
TEST_F(TypedTestSuitePStateDeathTest, DetectsDuplicates)
TEST_F(TypedTestSuitePStateDeathTest, DetectsExtraTest)
TEST_F(TypedTestSuitePStateDeathTest, DetectsMissedTest)
TEST_F(TypedTestSuitePStateDeathTest, DetectsTestAfterRegistration)
TYPED_TEST_SUITE_P(DerivedTest)
TYPED_TEST_P(DerivedTest, ValuesAreCorrect)
TYPED_TEST_P(DerivedTest, ValuesAreStillCorrect)
REGISTER_TYPED_TEST_SUITE_P(DerivedTest, ValuesAreCorrect, ValuesAreStillCorrect)
INSTANTIATE_TYPED_TEST_SUITE_P(My, DerivedTest, MyTwoTypes)
TYPED_TEST_SUITE_P(TypeParametrizedTestWithNames)
TYPED_TEST_P(TypeParametrizedTestWithNames, TestSuiteName)
REGISTER_TYPED_TEST_SUITE_P(TypeParametrizedTestWithNames, TestSuiteName)
INSTANTIATE_TYPED_TEST_SUITE_P(CustomName, TypeParametrizedTestWithNames, TwoTypes, TypeParametrizedTestNames)
TYPED_TEST_SUITE_P(TypedTestP1)
TYPED_TEST_P(TypedTestP1, A)
TYPED_TEST_P(TypedTestP1, B)
REGISTER_TYPED_TEST_SUITE_P(TypedTestP1, A, B)
TYPED_TEST_SUITE_P(TypedTestP2)
TYPED_TEST_P(TypedTestP2, A)
REGISTER_TYPED_TEST_SUITE_P(TypedTestP2, A)
INSTANTIATE_TYPED_TEST_SUITE_P(Int, TypedTestP1, int)
INSTANTIATE_TYPED_TEST_SUITE_P(Int, TypedTestP2, Types<int>)
INSTANTIATE_TYPED_TEST_SUITE_P(Double, TypedTestP2, Types<double>)
INSTANTIATE_TYPED_TEST_SUITE_P(My, ContainerTest, MyContainers)
file gtest-typed-test_test.h
#include “gtest/gtest.h”

Functions

TYPED_TEST_SUITE_P(ContainerTest)
TYPED_TEST_P(ContainerTest, CanBeDefaultConstructed)
TYPED_TEST_P(ContainerTest, InitialSizeIsZero)
REGISTER_TYPED_TEST_SUITE_P(ContainerTest, CanBeDefaultConstructed, InitialSizeIsZero)
file gtest-unittest-api_test.cc
#include “gtest/gtest.h”#include <string.h>#include <algorithm>

Functions

int main(int argc, char **argv)
file gtest_all_test.cc
#include “test/googletest-filepath-test.cc”#include “test/googletest-message-test.cc”#include “test/googletest-options-test.cc”#include “test/googletest-port-test.cc”#include “test/googletest-test-part-test.cc”#include “test/gtest-typed-test2_test.cc”#include “test/gtest-typed-test_test.cc”#include “test/gtest_pred_impl_unittest.cc”#include “test/gtest_prod_test.cc”#include “test/gtest_skip_test.cc”#include “test/gtest_unittest.cc”#include “test/production.cc”
file gtest_assert_by_exception_test.cc
#include “gtest/gtest.h”#include <stdlib.h>#include <stdio.h>#include <string.h>#include <stdexcept>

Functions

void Fail(const char *msg)
static void AssertFalse()
TEST(Test, Test)
TEST(Test, Test2)
int main(int argc, char **argv)

Variables

int kTestForContinuingTest = 0
file gtest_environment_test.cc
#include <stdlib.h>#include <stdio.h>#include “gtest/gtest.h”#include “src/gtest-internal-inl.h”

Enums

enum FailureType

Values:

Functions

int main(int argc, char **argv)
file gtest_help_test_.cc
#include “gtest/gtest.h”

Functions

TEST(HelpFlagTest, ShouldNotBeRun)
file gtest_list_output_unittest_.cc
#include “gtest/gtest.h”

Typedefs

typedef testing::Types<int, bool> TypedTestTypes
typedef testing::Types<int, bool> TypeParameterizedTestSuiteTypes

Functions

TEST(FooTest, Test1)
TEST(FooTest, Test2)
TEST_F(FooTestFixture, Test3)
TEST_F(FooTestFixture, Test4)
TEST_P(ValueParamTest, Test5)
TEST_P(ValueParamTest, Test6)
INSTANTIATE_TEST_SUITE_P (ValueParam, ValueParamTest, ::testing::Values(33, 42))
TYPED_TEST_SUITE(TypedTest, TypedTestTypes)
TYPED_TEST(TypedTest, Test7)
TYPED_TEST(TypedTest, Test8)
TYPED_TEST_SUITE_P(TypeParameterizedTestSuite)
TYPED_TEST_P(TypeParameterizedTestSuite, Test9)
TYPED_TEST_P(TypeParameterizedTestSuite, Test10)
REGISTER_TYPED_TEST_SUITE_P(TypeParameterizedTestSuite, Test9, Test10)
INSTANTIATE_TYPED_TEST_SUITE_P(Single, TypeParameterizedTestSuite, TypeParameterizedTestSuiteTypes)
int main(int argc, char **argv)
file gtest_main_unittest.cc
#include “gtest/gtest.h”
file gtest_no_test_unittest.cc
#include “gtest/gtest.h”

Functions

int main(int argc, char **argv)
file gtest_pred_impl_unittest.cc
#include <iostream>#include “gtest/gtest.h”#include “gtest/gtest-spi.h”

Typedefs

typedef Predicate1Test EXPECT_PRED_FORMAT1Test
typedef Predicate1Test ASSERT_PRED_FORMAT1Test
typedef Predicate1Test EXPECT_PRED1Test
typedef Predicate1Test ASSERT_PRED1Test
typedef Predicate2Test EXPECT_PRED_FORMAT2Test
typedef Predicate2Test ASSERT_PRED_FORMAT2Test
typedef Predicate2Test EXPECT_PRED2Test
typedef Predicate2Test ASSERT_PRED2Test
typedef Predicate3Test EXPECT_PRED_FORMAT3Test
typedef Predicate3Test ASSERT_PRED_FORMAT3Test
typedef Predicate3Test EXPECT_PRED3Test
typedef Predicate3Test ASSERT_PRED3Test
typedef Predicate4Test EXPECT_PRED_FORMAT4Test
typedef Predicate4Test ASSERT_PRED_FORMAT4Test
typedef Predicate4Test EXPECT_PRED4Test
typedef Predicate4Test ASSERT_PRED4Test
typedef Predicate5Test EXPECT_PRED_FORMAT5Test
typedef Predicate5Test ASSERT_PRED_FORMAT5Test
typedef Predicate5Test EXPECT_PRED5Test
typedef Predicate5Test ASSERT_PRED5Test

Functions

std::ostream &operator<<(std::ostream &os, const Bool &x)
template<typename T1>
bool PredFunction1(T1 v1)
bool PredFunction1Int(int v1)
bool PredFunction1Bool(Bool v1)
template<typename T1>
testing::AssertionResult PredFormatFunction1(const char *e1, const T1 &v1)
TEST_F(EXPECT_PRED1Test, FunctionOnBuiltInTypeSuccess)
TEST_F(EXPECT_PRED1Test, FunctionOnUserTypeSuccess)
TEST_F(EXPECT_PRED1Test, FunctorOnBuiltInTypeSuccess)
TEST_F(EXPECT_PRED1Test, FunctorOnUserTypeSuccess)
TEST_F(EXPECT_PRED1Test, FunctionOnBuiltInTypeFailure)
TEST_F(EXPECT_PRED1Test, FunctionOnUserTypeFailure)
TEST_F(EXPECT_PRED1Test, FunctorOnBuiltInTypeFailure)
TEST_F(EXPECT_PRED1Test, FunctorOnUserTypeFailure)
template<typename T1, typename T2>
bool PredFunction2(T1 v1, T2 v2)
bool PredFunction2Int(int v1, int v2)
bool PredFunction2Bool(Bool v1, Bool v2)
template<typename T1, typename T2>
testing::AssertionResult PredFormatFunction2(const char *e1, const char *e2, const T1 &v1, const T2 &v2)
TEST_F(EXPECT_PRED2Test, FunctionOnBuiltInTypeSuccess)
TEST_F(EXPECT_PRED2Test, FunctionOnUserTypeSuccess)
TEST_F(EXPECT_PRED2Test, FunctorOnBuiltInTypeSuccess)
TEST_F(EXPECT_PRED2Test, FunctorOnUserTypeSuccess)
TEST_F(EXPECT_PRED2Test, FunctionOnBuiltInTypeFailure)
TEST_F(EXPECT_PRED2Test, FunctionOnUserTypeFailure)
TEST_F(EXPECT_PRED2Test, FunctorOnBuiltInTypeFailure)
TEST_F(EXPECT_PRED2Test, FunctorOnUserTypeFailure)
template<typename T1, typename T2, typename T3>
bool PredFunction3(T1 v1, T2 v2, T3 v3)
bool PredFunction3Int(int v1, int v2, int v3)
bool PredFunction3Bool(Bool v1, Bool v2, Bool v3)
template<typename T1, typename T2, typename T3>
testing::AssertionResult PredFormatFunction3(const char *e1, const char *e2, const char *e3, const T1 &v1, const T2 &v2, const T3 &v3)
TEST_F(EXPECT_PRED3Test, FunctionOnBuiltInTypeSuccess)
TEST_F(EXPECT_PRED3Test, FunctionOnUserTypeSuccess)
TEST_F(EXPECT_PRED3Test, FunctorOnBuiltInTypeSuccess)
TEST_F(EXPECT_PRED3Test, FunctorOnUserTypeSuccess)
TEST_F(EXPECT_PRED3Test, FunctionOnBuiltInTypeFailure)
TEST_F(EXPECT_PRED3Test, FunctionOnUserTypeFailure)
TEST_F(EXPECT_PRED3Test, FunctorOnBuiltInTypeFailure)
TEST_F(EXPECT_PRED3Test, FunctorOnUserTypeFailure)
template<typename T1, typename T2, typename T3, typename T4>
bool PredFunction4(T1 v1, T2 v2, T3 v3, T4 v4)
bool PredFunction4Int(int v1, int v2, int v3, int v4)
bool PredFunction4Bool(Bool v1, Bool v2, Bool v3, Bool v4)
template<typename T1, typename T2, typename T3, typename T4>
testing::AssertionResult PredFormatFunction4(const char *e1, const char *e2, const char *e3, const char *e4, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4)
TEST_F(EXPECT_PRED4Test, FunctionOnBuiltInTypeSuccess)
TEST_F(EXPECT_PRED4Test, FunctionOnUserTypeSuccess)
TEST_F(EXPECT_PRED4Test, FunctorOnBuiltInTypeSuccess)
TEST_F(EXPECT_PRED4Test, FunctorOnUserTypeSuccess)
TEST_F(EXPECT_PRED4Test, FunctionOnBuiltInTypeFailure)
TEST_F(EXPECT_PRED4Test, FunctionOnUserTypeFailure)
TEST_F(EXPECT_PRED4Test, FunctorOnBuiltInTypeFailure)
TEST_F(EXPECT_PRED4Test, FunctorOnUserTypeFailure)
template<typename T1, typename T2, typename T3, typename T4, typename T5>
bool PredFunction5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5)
bool PredFunction5Int(int v1, int v2, int v3, int v4, int v5)
bool PredFunction5Bool(Bool v1, Bool v2, Bool v3, Bool v4, Bool v5)
template<typename T1, typename T2, typename T3, typename T4, typename T5>
testing::AssertionResult PredFormatFunction5(const char *e1, const char *e2, const char *e3, const char *e4, const char *e5, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5)
TEST_F(EXPECT_PRED5Test, FunctionOnBuiltInTypeSuccess)
TEST_F(EXPECT_PRED5Test, FunctionOnUserTypeSuccess)
TEST_F(EXPECT_PRED5Test, FunctorOnBuiltInTypeSuccess)
TEST_F(EXPECT_PRED5Test, FunctorOnUserTypeSuccess)
TEST_F(EXPECT_PRED5Test, FunctionOnBuiltInTypeFailure)
TEST_F(EXPECT_PRED5Test, FunctionOnUserTypeFailure)
TEST_F(EXPECT_PRED5Test, FunctorOnBuiltInTypeFailure)
TEST_F(EXPECT_PRED5Test, FunctorOnUserTypeFailure)
file gtest_premature_exit_test.cc
#include <stdio.h>#include “gtest/gtest.h”

Functions

int main(int argc, char **argv)
file gtest_prod_test.cc
#include “production.h”#include “gtest/gtest.h”

Typedefs

typedef testing::Test PrivateCodeFixtureTest

Functions

TEST(PrivateCodeTest, CanAccessPrivateMembers)
TEST_F(PrivateCodeFixtureTest, CanAccessPrivateMembers)
file gtest_repeat_test.cc
#include <stdlib.h>#include <iostream>#include “gtest/gtest.h”#include “src/gtest-internal-inl.h”

Defines

GTEST_CHECK_INT_EQ_(expected, actual)

Functions

int main(int argc, char **argv)
file gtest_skip_in_environment_setup_test.cc
#include <iostream>#include “gtest/gtest.h”

Functions

TEST(Test, AlwaysFails)
int main(int argc, char **argv)
file gtest_skip_test.cc
#include “gtest/gtest.h”

Functions

TEST(SkipTest, DoesSkip)
TEST_F(Fixture, SkipsOneTest)
TEST_F(Fixture, SkipsAnotherTest)
file gtest_sole_header_test.cc
#include “gtest/gtest.h”
file gtest_stress_test.cc
#include “gtest/gtest.h”#include <vector>#include “src/gtest-internal-inl.h”

Functions

TEST(StressTest, DISABLED_ThreadSafetyTestsAreSkippedWhenGoogleTestIsNotThreadSafe)
int main(int argc, char **argv)
file gtest_test_macro_stack_footprint_test.cc
#include “gtest/gtest.h”

Defines

TEN_TESTS_(test_case_name)
HUNDRED_TESTS_(test_case_name_prefix)
THOUSAND_TESTS_(test_case_name_prefix)

Functions

int main(int argc, char **argv)
file gtest_testbridge_test_.cc
#include “gtest/gtest.h”

Functions

TEST(TestFilterTest, TestThatSucceeds)
TEST(TestFilterTest, TestThatFails)
file gtest_throw_on_failure_ex_test.cc
#include “gtest/gtest.h”#include <stdlib.h>#include <stdio.h>#include <string.h>#include <stdexcept>

Functions

void Fail(const char *msg)
void TestFailureThrowsRuntimeError()
int main(int argc, char **argv)
file gtest_unittest.cc
#include “gtest/gtest.h”#include <limits.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <cstdint>#include <map>#include <ostream>#include <string>#include <type_traits>#include <unordered_set>#include <vector>#include “gtest/gtest-spi.h”#include “src/gtest-internal-inl.h”

Defines

GTEST_USE_UNPROTECTED_COMMA_
VERIFY_CODE_LOCATION
GTEST_TEST_PARSING_FLAGS_(argv1, argv2, expected, should_print_help)
GTEST_FLAT_TUPLE_INT8
GTEST_FLAT_TUPLE_INT16
GTEST_FLAT_TUPLE_INT32
GTEST_FLAT_TUPLE_INT64
GTEST_FLAT_TUPLE_INT128
GTEST_FLAT_TUPLE_INT256

Typedefs

typedef int IntAlias

Enums

enum NamedEnum

Values:

enum [anonymous]

Values:

Functions

TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded)
::std::ostream &operator<<(::std::ostream &os, const TestingVector &vector)
TEST(AssertionResultTest, CopyConstructorWorksWhenNotOptimied)
TEST(AssertionResultTest, ConstructionWorks)
TEST(AssertionResultTest, NegationWorks)
TEST(AssertionResultTest, StreamingWorks)
TEST(AssertionResultTest, CanStreamOstreamManipulators)
TEST(AssertionResultTest, ConstructibleFromContextuallyConvertibleToBool)
TEST(AssertionResultTest, ConstructibleFromImplicitlyConvertible)
std::ostream &operator<<(std::ostream &os, const Base &val)
std::ostream &operator<<(std::ostream &os, const Base *pointer)
TEST(MessageTest, CanStreamUserTypeInGlobalNameSpace)
TEST(MessageTest, CanStreamUserTypeInUnnamedNameSpace)
TEST(MessageTest, CanStreamUserTypeInUserNameSpace)
std::ostream &operator<<(std::ostream &os, const namespace2::MyTypeInNameSpace2 &val)
std::ostream &operator<<(std::ostream &os, const namespace2::MyTypeInNameSpace2 *pointer)
TEST(MessageTest, CanStreamUserTypeInUserNameSpaceWithStreamOperatorInGlobal)
TEST(MessageTest, NullPointers)
TEST(MessageTest, WideStrings)
TEST(StreamingAssertionsTest, Unconditional)
TEST(StreamingAssertionsTest, Truth)
TEST(StreamingAssertionsTest, Truth2)
TEST(StreamingAssertionsTest, IntegerEquals)
TEST(StreamingAssertionsTest, IntegerLessThan)
TEST(StreamingAssertionsTest, StringsEqual)
TEST(StreamingAssertionsTest, StringsNotEqual)
TEST(StreamingAssertionsTest, StringsEqualIgnoringCase)
TEST(StreamingAssertionsTest, StringNotEqualIgnoringCase)
TEST(StreamingAssertionsTest, FloatingPointEquals)
TEST(ColoredOutputTest, UsesColorsWhenGTestColorFlagIsYes)
TEST(ColoredOutputTest, UsesColorsWhenGTestColorFlagIsAliasOfYes)
TEST(ColoredOutputTest, UsesNoColorWhenGTestColorFlagIsNo)
TEST(ColoredOutputTest, UsesNoColorWhenGTestColorFlagIsInvalid)
TEST(ColoredOutputTest, UsesColorsWhenStdoutIsTty)
TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors)
TEST(StaticAssertTypeEqTest, WorksInClass)
TEST(StaticAssertTypeEqTest, CompilesForEqualTypes)
TEST(HasNonfatalFailureTest, ReturnsFalseWhenThereIsNoFailure)
static void FailFatally()
TEST(HasNonfatalFailureTest, ReturnsFalseWhenThereIsOnlyFatalFailure)
TEST(HasNonfatalFailureTest, ReturnsTrueWhenThereIsNonfatalFailure)
TEST(HasNonfatalFailureTest, ReturnsTrueWhenThereAreFatalAndNonfatalFailures)
static bool HasNonfatalFailureHelper()
TEST(HasNonfatalFailureTest, WorksOutsideOfTestBody)
TEST(HasNonfatalFailureTest, WorksOutsideOfTestBody2)
TEST(HasFailureTest, ReturnsFalseWhenThereIsNoFailure)
TEST(HasFailureTest, ReturnsTrueWhenThereIsFatalFailure)
TEST(HasFailureTest, ReturnsTrueWhenThereIsNonfatalFailure)
TEST(HasFailureTest, ReturnsTrueWhenThereAreFatalAndNonfatalFailures)
static bool HasFailureHelper()
TEST(HasFailureTest, WorksOutsideOfTestBody)
TEST(HasFailureTest, WorksOutsideOfTestBody2)
TEST(TestEventListenersTest, ConstructionWorks)
TEST(TestEventListenersTest, DestructionWorks)
TEST(TestEventListenersTest, Append)
TEST(EventListenerTest, AppendKeepsOrder)
TEST(TestEventListenersTest, Release)
TEST(EventListenerTest, SuppressEventForwarding)
TEST(EventListenerDeathTest, EventsNotForwardedInDeathTestSubprecesses)
TEST(EventListenerTest, default_result_printer)
TEST(EventListenerTest, RemovingDefaultResultPrinterWorks)
TEST(EventListenerTest, default_xml_generator)
TEST(EventListenerTest, RemovingDefaultXmlGeneratorWorks)
GTEST_TEST(AlternativeNameTest, Works)
TEST(HasDebugStringAndShortDebugStringTest, ValueIsCompileTimeConstant)
TEST(HasDebugStringAndShortDebugStringTest, ValueIsTrueWhenTypeHasDebugStringAndShortDebugString)
TEST(HasDebugStringAndShortDebugStringTest, ValueIsFalseWhenTypeIsNotAProtocolMessage)
template<typename T1, typename T2>
void TestGTestRemoveReferenceAndConst()
TEST(RemoveReferenceToConstTest, Works)
template<typename T1, typename T2>
void TestGTestReferenceToConst()
TEST(GTestReferenceToConstTest, Works)
TEST(IsContainerTestTest, WorksForNonContainer)
TEST(IsContainerTestTest, WorksForContainer)
TEST(IsContainerTestTest, ConstOnlyContainer)
TEST(IsHashTable, Basic)
TEST(ArrayEqTest, WorksForDegeneratedArrays)
TEST(ArrayEqTest, WorksForOneDimensionalArrays)
TEST(ArrayEqTest, WorksForTwoDimensionalArrays)
TEST(ArrayAwareFindTest, WorksForOneDimensionalArray)
TEST(ArrayAwareFindTest, WorksForTwoDimensionalArray)
TEST(CopyArrayTest, WorksForDegeneratedArrays)
TEST(CopyArrayTest, WorksForOneDimensionalArrays)
TEST(CopyArrayTest, WorksForTwoDimensionalArrays)
TEST(NativeArrayTest, ConstructorFromArrayWorks)
TEST(NativeArrayTest, CreatesAndDeletesCopyOfArrayWhenAskedTo)
TEST(NativeArrayTest, TypeMembersAreCorrect)
TEST(NativeArrayTest, MethodsWork)
TEST(NativeArrayTest, WorksForTwoDimensionalArray)
TEST(IndexSequence, MakeIndexSequence)
TEST(ElemFromList, Basic)
TEST(FlatTuple, Basic)
TEST(FlatTuple, Apply)
TEST(FlatTuple, ConstructorCalls)
TEST(FlatTuple, ManyTypes)
TEST(SkipPrefixTest, SkipsWhenPrefixMatches)
TEST(SkipPrefixTest, DoesNotSkipWhenPrefixDoesNotMatch)
TEST(AdHocTestResultTest, AdHocTestResultForUnitTestDoesNotShowFailure)
TEST(RegisterTest, WasRegistered)

Variables

static bool dummy1 GTEST_ATTRIBUTE_UNUSED_   = StaticAssertTypeEq<bool, bool>()
auto *dynamic_test = testing::RegisterTest("DynamicUnitTestFixture", "DynamicTest", "TYPE", "VALUE", __FILE__,__LINE__, []() ->DynamicUnitTestFixture* { return new DynamicTest; })
file gtest_xml_outfile1_test_.cc
#include “gtest/gtest.h”

Functions

TEST_F(PropertyOne, TestSomeProperties)
file gtest_xml_outfile2_test_.cc
#include “gtest/gtest.h”

Functions

TEST_F(PropertyTwo, TestSomeProperties)
file gtest_xml_output_unittest_.cc
#include “gtest/gtest.h”

Typedefs

typedef testing::Types<int, long> TypedTestTypes
typedef testing::Types<int, long> TypeParameterizedTestSuiteTypes

Functions

TEST_F(SuccessfulTest, Succeeds)
TEST_F(FailedTest, Fails)
TEST_F(DisabledTest, DISABLED_test_not_run)
TEST_F(SkippedTest, Skipped)
TEST_F(SkippedTest, SkippedWithMessage)
TEST_F(SkippedTest, SkippedAfterFailure)
TEST(MixedResultTest, Succeeds)
TEST(MixedResultTest, Fails)
TEST(MixedResultTest, DISABLED_test)
TEST(XmlQuotingTest, OutputsCData)
TEST(InvalidCharactersTest, InvalidCharactersInMessage)
TEST_F(PropertyRecordingTest, OneProperty)
TEST_F(PropertyRecordingTest, IntValuedProperty)
TEST_F(PropertyRecordingTest, ThreeProperties)
TEST_F(PropertyRecordingTest, TwoValuesForOneKeyUsesLastValue)
TEST(NoFixtureTest, RecordProperty)
void ExternalUtilityThatCallsRecordProperty(const std::string &key, int value)
void ExternalUtilityThatCallsRecordProperty(const std::string &key, const std::string &value)
TEST(NoFixtureTest, ExternalUtilityThatCallsRecordIntValuedProperty)
TEST(NoFixtureTest, ExternalUtilityThatCallsRecordStringValuedProperty)
TEST_P(ValueParamTest, HasValueParamAttribute)
TEST_P(ValueParamTest, AnotherTestThatHasValueParamAttribute)
INSTANTIATE_TEST_SUITE_P (Single, ValueParamTest, Values(33, 42))
TYPED_TEST_SUITE(TypedTest, TypedTestTypes)
TYPED_TEST(TypedTest, HasTypeParamAttribute)
TYPED_TEST_SUITE_P(TypeParameterizedTestSuite)
TYPED_TEST_P(TypeParameterizedTestSuite, HasTypeParamAttribute)
REGISTER_TYPED_TEST_SUITE_P(TypeParameterizedTestSuite, HasTypeParamAttribute)
INSTANTIATE_TYPED_TEST_SUITE_P(Single, TypeParameterizedTestSuite, TypeParameterizedTestSuiteTypes)
int main(int argc, char **argv)
file production.cc
#include “production.h”
file production.h
#include “gtest/gtest_prod.h”
file default_configuration.hpp
#include “package_template/gains_configuration.hpp”

Author

Vincent Berenz

Copyright

Copyright (c) 2019, New York University and Max Planck Gesellschaft, License BSD-3-Clause

Date

2019-12-09

Defines

DEFAULT_KP
DEFAULT_KD
DEFAULT_KI
file file_configuration.hpp
#include “package_template/gains_configuration.hpp”#include “yaml-cpp/yaml.h”

Author

Vincent Berenz

Copyright

Copyright (c) 2019, New York University and Max Planck Gesellschaft, License BSD-3-Clause

Date

2019-12-09

file gains_configuration.hpp
#include <iostream>#include <string>

Author

Vincent Berenz

Copyright

Copyright (c) 2019, New York University and Max Planck Gesellschaft, License BSD-3-Clause

Date

2019-12-09

file pid.hpp
#include <memory>#include <vector>#include “package_template/default_configuration.hpp”

Author

Vincent Berenz

Copyright

Copyright (c) 2019, New York University and Max Planck Gesellschaft, License BSD-3-Clause

Date

2019-12-09

file rosparameters_configuration.hpp
#include “package_template_cpp/gains_configuration.hpp”#include “ros/master.h”#include “ros/ros.h”

Author

Vincent Berenz

Copyright

Copyright (c) 2019, New York University and Max Planck Gesellschaft, License BSD-3-Clause

Date

2019-12-09

Defines

ROSPARAM_KP
ROSPARAM_KD
ROSPARAM_KI
file basic_pid.cpp
#include “package_template/basic_pid.hpp”

Author

Vincent Berenz license License BSD-3-Clause

Copyright

Copyright (c) 2019, New York University and Max Planck Gesellschaft.

Date

2019-05-22

file default_configuration.cpp
#include “package_template/default_configuration.hpp”

Author

Vincent Berenz

Copyright

Copyright (c) 2019, New York University and Max Planck Gesellschaft, License BSD-3-Clause

Date

2019-12-09

file file_configuration.cpp
#include “package_template/file_configuration.hpp”

Author

Vincent Berenz

Copyright

Copyright (c) 2019, New York University and Max Planck Gesellschaft, License BSD-3-Clause

Date

2019-12-09

file gains_configuration.cpp
#include “package_template/gains_configuration.hpp”

Author

Vincent Berenz

Copyright

Copyright (c) 2019, New York University and Max Planck Gesellschaft, License BSD-3-Clause

Date

2019-12-09

file pid.cpp
#include “package_template/pid.hpp”

Author

Vincent Berenz

Copyright

Copyright (c) 2019, New York University and Max Planck Gesellschaft, License BSD-3-Clause

Date

2019-12-09

file rosparameters_configuration.cpp
#include “package_template/rosparameters_configuration.hpp”

Author

Vincent Berenz

Copyright

Copyright (c) 2019, New York University and Max Planck Gesellschaft, License BSD-3-Clause

Date

2019-12-09

file wrappers.cpp
#include <pybind11/pybind11.h>#include “package_template/pid.hpp”

Functions

PYBIND11_MODULE(package_template_cpp_bindings, m)
group python_builtins

Unless stated otherwise, the following C++ functions behave the same as their Python counterparts.

group annotations
group pytypes
dir demos
dir devel/workspace/install/pybind11/include/pybind11/detail
dir devel/workspace/src/pybind11/include/pybind11/detail
dir devel
dir devel/workspace/install/googletest-distribution/include/gmock
dir devel/workspace/src/googletest/googlemock/include/gmock
dir devel/workspace/src/googletest/googlemock
dir devel/workspace/src/googletest
dir devel/workspace/src/googletest/googletest
dir devel/workspace/install/googletest-distribution
dir devel/workspace/src/googletest/googletest/include/gtest
dir devel/workspace/install/googletest-distribution/include/gtest
dir devel/workspace/install/pybind11/include
dir include
dir devel/workspace/src/pybind11/include
dir devel/workspace/src/googletest/googlemock/include
dir devel/workspace/install/yaml_utils/include
dir devel/workspace/install/googletest-distribution/include
dir devel/workspace/src/yaml_utils/include
dir devel/workspace/src/googletest/googletest/include
dir devel/workspace/install
dir include/package_template
dir devel/workspace/install/pybind11
dir devel/workspace/install/pybind11/include/pybind11
dir devel/workspace/src/pybind11
dir devel/workspace/src/pybind11/include/pybind11
dir devel/workspace/src/googletest/googletest/samples
dir devel/workspace/src/googletest/googletest/src
dir devel/workspace/src/googletest/googlemock/src
dir devel/workspace/src
dir src
dir srcpy
dir devel/workspace/src/googletest/googletest/test
dir devel/workspace/src/googletest/googlemock/test
dir devel/workspace
dir devel/workspace/install/yaml_utils
dir devel/workspace/install/yaml_utils/include/yaml_utils
dir devel/workspace/src/yaml_utils
dir devel/workspace/src/yaml_utils/include/yaml_utils
example demo_pid.cpp

Create the default PID controller and compute the control once. This illustrates in the simplest way the use of the PID class API.


#include "package_template/pid.hpp"

void run_demo()
{
    // PID controller with default gains values
    package_template::PID& controller =
        package_template::get_default_pid();

    // example of force computation
    double current_position = 1;
    double current_velocity = 1;
    double delta_time = 0.01;
    double target_position = 2;
    double force = controller.compute(
        current_position, current_velocity, target_position, delta_time);
    std::cout << "computed force: " << force << std::endl;

    // resetting integral of the controller
    // (useless here because we do not reuse it)
    controller.reset_integral();
}

int main()
{
    try
    {
        run_demo();
    }
    catch (const std::exception& e)
    {
        std::cout << "demo failed !\nerror message:\n" << e.what() << std::endl;
        return 1;  // informs continuous integration that this demo did not run
                   // successfully
    }

    return 0;  // informs continuous integration that this demo did run
               // successfully
}

example demo_pid_load_from_file.cpp

Load the PID gains from a yaml file and create a PID controller from them.This illustrates how to safely use the API when yaml file parsing is wanted.


#include <stdexcept>
#include "package_template/file_configuration.hpp"
#include "package_template/pid.hpp"

void run_demo()
{
    /* displaying what this demo is about */
    std::cout << "This demo shows how to create an executable run by the "
                 "continuous integration\n"
              << "which depends on a configuration file. In the solution "
                 "showed here, the absolute path\n"
              << "to the configuration file is set during pre-compilation. See "
                 "code in /demos/demo_pid_load_from_file.cpp\n"
              << "for details\n\n";

    /* reading gains (kp,kd,ki) from yaml config */

    // (look at the CMakeLists.txt to see why TEST_PID_GAINS_YAML_FILE_PATH is
    // replaced by correct abs path  during compilation)
    std::string config_file_path = TEST_PID_GAINS_YAML_FILE_PATH;

    // Gains_configuration is the base class for all configuration, including
    // the one read from yaml file, as done here.
    package_template::File_configuration gains =
        package_template::File_configuration(config_file_path);

    // printing to standard output the gains
    std::cout << "gains read from configuration file:" << std::endl;
    package_template::print_configuration(gains);

    // checking reading the config file when fine
    // if not, throwing corresponding error
    if (gains.has_error())
    {
        throw std::runtime_error(gains.get_error());
    }

    /* creating and running the controller */

    // PID controller creation
    package_template::PID controller(gains);

    // example of force computation
    double current_position = 1;
    double current_velocity = 1;
    double delta_time = 0.01;
    double target_position = 2;
    double force = controller.compute(
        current_position, current_velocity, target_position, delta_time);
    std::cout << "computed force: " << force << std::endl;

    // resetting integral of the controller
    controller.reset_integral();
}

int main()
{
    try
    {
        run_demo();
    }
    catch (const std::runtime_error& e)
    {
        std::cout << "demo failed !\nerror message:\n" << e.what() << std::endl;
        return 1;  // informs continuous integration that this demo did not run
                   // successfully
    }

    return 0;  // informs continuous integration that this demo did run
               // successfully
}